diff options
85 files changed, 335 insertions, 4478 deletions
@@ -8,53 +8,12 @@ # Shared objects (inc. Windows DLLs) *.dll *.so -*.so.* *.dylib -# Executables -*.exe -*.out -*.app -*.pd_* -examples/simpletest/simpletest - # VS files *.sdf *.tlog -# http://www.gnu.org/software/automake - -Makefile.in -Makefile - -# http://www.gnu.org/software/autoconf - -/autom4te.cache -/aclocal.m4 -/compile -/configure -/depcomp -/install-sh -/missing - -*.lo -*.la -m4/* -*.pc -libtool -ltmain.sh - -*.deps -*.libs -config.guess -config.log -config.status -config.sub -config.h -config.h.in -py-compile -stamp-h1 - # sublime *sublime* @@ -65,6 +24,10 @@ stamp-h1 # Doxygen doc/latex doc/html -doc/doxygen-build.stamp -doc/documentation.doxygen +# Build files +.build +dist + +# Project-specific files +examples/simpletest/simpletest diff --git a/ChangeLog b/ChangeLog deleted file mode 100644 index 83fca1e..0000000 --- a/ChangeLog +++ /dev/null @@ -1,134 +0,0 @@ -2008-3-26 Jamie Bullock <jamie@postlude.co.uk> - * version 0.6.0 - * Fixed build fail if --enable-fft not specified - * Fixed doxygen build so that it includes libxtract.h - * Doxygen tweaks - -2008-2-16 Jamie Bullock <jamie@postlude.co.uk> - * version 0.6.0 - * Added to pd example the ability to differentiate between different - argv types (XTRACT_FLOAT, XTRACT_INT) and pass the correct data type - to the xtract[]() function - * Added xtract_flatness_db() details to descriptors.c - * Fixes to tonality and xtract_subbands descriptors - * Added Pd examples for 'subband mean' and tonality calculated using subbands - -2008-2-15 Jamie Bullock <jamie@postlude.co.uk> - * version 0.5.9 - * Fixed bugs in xtract_flatness(), or at least added necessary - documentation and error checking to avoid problems - * Added xtract_is_denormal() helper function and XTRACT_DENORMAL_FOUND - return code - * Replaced all instances of log, sqrt, exp etc. with respective - floating point counterparts (logf etc.) - * Added check for architecture endianness to configure script - * Bug fix to PD example, now no longer crashes if no arguments are - given - * Minor documentation updates - -2007-10-09 Dan Stowell - * version 0.5.1 - * Fixed bug in xtract_init_mfcc() which accidentally missed filling in the very top filter frequency value - -2007-10-06 Jamie Bullock <jamie@postlude.co.uk> - * version 0.5.0 - * Removed fftw_plan creation from inner loop of functions that use fft - * Added new init function xtract_init_fft() for initialisation of - fft_plan out-of-place. The actual plans have global scope, and are - freed by the library destructor. - * Updated Max/MSP and PD examples too reflect the above change - * Made the fft optimistation level a compile-time option through - --with-fft-optimisation flag (0 = lowest, 2 = highest). - * Minor fixes. - -2007-10-04 Dan Stowell - * version 0.4.9 - * Fixed and tidied MFCC functions - -2007-09-04 Jamie Bullock <jamie@postlude.co.uk> - * version 0.4.8 - * Added cursory SWIG Python wrapper generator - -2007-04-20 Jamie Bullock <jamie@postlude.co.uk> - * version 0.4.7 - * Added MSP example - -2007-04-20 Jamie Bullock <jamie@postlude.co.uk> - * version 0.4.5 - * Fixed autocorrelation_fft() - * Added MAINTAINERCLEAN files to Makefile.am - -2007-03-14 Jamie Bullock <jamie@postlude.co.uk> - * version 0.4.4 - * Fixed return value macros for functions if fftw not used - * Fixed bug in xtract_spectrum() FFTW_R2HC not interpreted correctly - -2007-01-29 Jamie Bullock <jamie@postlude.co.uk> - * version 0.4.0 - * Added namespacing for macros and enumerations - * Made most macros private - * Rationalised formats for data (*data and argv) to create consistency - between functions - * Added spectral_mean() and friends - * Added feature descriptors (see libxtract.h/descriptors.c - -2006-12-15 Jamie Bullock <jamie@postlude.co.uk> - * version 0.3.4 - * Changed xtract_lowest_match(), to xtract_lowest(). It just returns the - lowest non-zero component in the input array, between two bounds - * qualified int *data, int N, and void *argv as const, thus insuring - that they won't be modified by the called function. - * added facilities for some functions to operate on copies of input - data instead of modifying it. This will need to be optimised at some - point maybe. - * Added arguments to spectral flatness to allow for control over input - band and pre-scaling - * Fixed confusing xtract_init_mfcc() parameter order - * Added new xtractor xtract_failsafe_f0 - -2006-12-12 Jamie Bullock <jamie@postlude.co.uk> - * version 0.3.3 - * Fixed errors in skewnes, kurtosis, irregularity_k, irregularity_j, - tristimulus_1, tristimulus_2, and tristimulus_3. - * Tested the above - * Changed rolloff so output is in Hz. This means that a second - argument (samplerate) needs to be passed in as argv[1] -2006-12-11 Jamie Bullock <jamie@postlude.co.uk> - * version 0.3.2 - * changed xtract_inharmonicity so that it takes frequencies AND - amplitudes of peaks from *data rather than via *argv. This is - consistent with xtract_centroid and others, and it means the data can - come directly from xtract_peaks - * Improvements to pd example (fixed memory allocation bugs) -2006-12-10 Jamie Bullock <jamie@postlude.co.uk> - * version 0.3.1 - * Fixed xtract_init_mfcc (array entries zeroed out if not set) -2006-11-10 Jamie Bullock <jamie@postlude.co.uk> - * version 0.3.0 - * Corrected typos in scalar.c - * Added -Wall to CFLAGS and corrected problems relating to warnings - * Added xtract_harmonics and corresponding documentation -2006-11-10 Jamie Bullock <jamie@postlude.co.uk> - * version 0.2.2 - * Fixed 'bus error' crash on Mac OS X by adding 'extern' declarations - to xtract and xtract_help_strings -2006-10-24 Jamie Bullock <jamie@postlude.co.uk> - * version 0.2.1 - * Fixed _xtract and _xtract_help_strings memory alloc bug - * Added new macro - _ -2006-10-18 Jamie Bullock <jamie@postlude.co.uk> - * version 0.2.0 - * added PD help files - * added simple help system - -2006-10-12 Jamie Bullock <jamie@postlude.co.uk> - * version 0.1.2 - * improved xtract_f0 - * changed versioning scheme - -2006-10-09 Jamie Bullock <jamie@postlude.co.uk> - * Released version 0.11 - - - diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e880ca9 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ + +LIBRARY ?= static +PREFIX ?= $(PWD)/dist + +HPATH = include/xtract + +export XTRACT_VERSION PREFIX LIBRARY + +.PHONY: examples clean install doc src swig + +all: src examples + +src: + @$(MAKE) -C $@ + +doc: + @$(MAKE) -C $@ + +examples: + @$(MAKE) -C $@ + +swig: src + @$(MAKE) -C $@ + +install: + @$(MAKE) -C src install + @$(MAKE) -C examples install + @mkdir -p $(PREFIX)/$(HPATH) + @cp $(HPATH)/* $(PREFIX)/$(HPATH) + +clean: + @$(MAKE) -C src clean + @$(MAKE) -C examples clean + @$(MAKE) -C swig clean + @$(RM) -r dist diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index e844bd3..0000000 --- a/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -MAINTAINERCLEANFILES = INSTALL Makefile.in configure depcomp compile config.guess ltmain.sh config.sub missing install-sh aclocal.m4 config.h.in config.h.in~ py-compile m4/ltsugar.m4 m4/libtool.m4 m4/ltversion.m4 m4/lt~obsolete.m4 m4/ltoptions.m4 - -if BUILD_SWIG -SWIG_DIR = swig -endif - -if HAVE_DOXYGEN -DOXY_DIR = @DOXYGEN@ -endif - -SUBDIRS = src xtract examples $(SWIG_DIR) doc - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libxtract.pc - -ACLOCAL_AMFLAGS = -I m4 - -EXTRA_DIST = examples/MSP \ - bootstrap \ - autogen.sh \ - README.md \ - TODO \ - $(SWIG_DIR)/java/*.java \ - $(SWIG_DIR)/java/xtract/core/src/* \ - $(SWIG_DIR)/python/test.py \ - $(SWIG_DIR)/python/__init__.py - @@ -18,98 +18,12 @@ The latest source code release for LibXtract can be downloaded from [https://git ## Dependencies -To build the PD external, the PD header 'm_pd.h' is required, this can be found in the [Pure Data source code release](http://puredata.info/downloads/pure-data). - -If you are compiling LibXtract from a GIT clone, the **autotools** build system is required. This includes: - - automake >= 1.11 - autoconf >= 2.68 - libtool >= 2.4 +To build the SWIG bindings [SWIG]() is required. For the Python bindings, a Python install is required. For the Java bindings a Java install is required. ## Installation -If you are installing from a GIT clone, first run: - - sh autogen.sh - -If autogen.sh was successful, or you downloaded the source release, type: - - ./configure --enable-pd_example - make - sudo make install - -There following configure flags are optional: - - --enable-pd_example (to build the PD example) - --enable-simpletest (to build the simpletest example) - -If you wish to build a Universal binary on OS X, you may need to do something like this: - - CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" \./configure --isable-dependency-tracking --your-options - -## Building the MSP external - -Type: - - cd examples/MSP - make - sudo make install - -To build for a specific architecture: - - make intel - or - make ppc - -## Building the Python bindings - -To build the python bindings, add to your configure flags: - - --enable-swig --with-python - -This requres additional dependencies to be resolved: - - swig >= 1.3 - python (with development files) >= 2.5 - -It might work with earlier versions of Python, but this has not been tested. +Type `make install` to build and install to `/usr/local`. Type `make install PREFIX=/somewhere/else` to install to `/somewhere/else`, -If you do not have the 'standard' version of Python on OS X, you might need to tell the configure script where the python library is e.g.: - - ./configure --your-flags LDFLAGS="-L/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config/" - -To find your Python library type: - - locate libpython - -NOTE: The python module will get installed under the main install prefix, so if your install prefix is set to /usr/local, then the python module will get installed to /usr/local/lib/python2.5/site-packages/libxtract/xtract. You may need to add this to your PYTHONPATH environment variable. For example in ~/.bash_profile add: - export PYTHONPATH=/usr/local/lib/python2.7/site-packages - - -## Building the Java bindings - -To build the java bindings, add to your configure flags: - - --enable-swig --with-java - -This requres additional dependencies to be resolved: - - swig >= 1.3 - java (with development files) >= 2.0 - -It might work with other versions of Java, but this has not been tested. - -On OS X, you will probably need to set your CLASSPATH environment variable before running ./configure - - export CLASSPATH=/System/Library/Frameworks/JavaVM.framework/Classes/classes.jar - -On OS X, you also probably need to tell the configure script where to find your Java (JNI) headers. - - ./configure --flags CFLAGS="-I/System/Library/Frameworks/JavaVM.framework/Headers" - -To find out where your headers are: - - locate jni.h ## Documentation @@ -123,8 +37,6 @@ The generated HTML documentation can then be viewed in a web browser by opening - - ## LicenseĀ Copyright (C) 2012 Jamie Bullock @@ -0,0 +1 @@ +0.7.2 diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index cc118e8..0000000 --- a/autogen.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh - -# This works on Gentoo, whose automake wrapper is based on Mandrake: -WANT_AUTOMAKE=1.6 -export WANT_AUTOMAKE - - -case `uname -s` in - Linux) - LIBTOOLIZE=libtoolize - ACLOCALARGS='-I m4' - ;; - Darwin) - LIBTOOLIZE=glibtoolize - ACLOCALARGS='-I m4' - ;; - *) echo error: unrecognized OS - exit 1 - ;; -esac - -AUTOMAKE_REQ=1.6 - -# Automake version check from MusE -lessthan () { - ver1="$1" - ver2="$2" - - major1=$( echo $ver1 | sed "s/^\([0-9]*\)\..*/\1/"); - minor1=$( echo $ver1 | sed "s/^[^\.]*\.\([0-9]*\).*/\1/" ); - major2=$( echo $ver2 | sed "s/^\([0-9]*\)\..*/\1/"); - minor2=$( echo $ver2 | sed "s/^[^\.]*\.\([0-9]*\).*/\1/" ); - test "$major1" -lt "$major2" || test "$minor1" -lt "$minor2"; -} - -amver=$( automake --version | head -n 1 | sed "s/.* //" ); -if lessthan $amver $AUTOMAKE_REQ ; then - echo "you must have automake version >= $AUTOMAKE_REQ to proper plugin support" - exit 1 -fi - - -echo "=============== running libtoolize --force --copy" && - $LIBTOOLIZE --force --copy && - echo "=============== running aclocal" && - aclocal $ACLOCALARGS && - echo "=============== running autoheader" && - autoheader && - echo "=============== running automake -c --add-missing --foreign" && - automake -c --add-missing --foreign && - echo "=============== running autoconf" && - autoconf && - echo "=============== done" - diff --git a/bootstrap b/bootstrap deleted file mode 100644 index eff731b..0000000 --- a/bootstrap +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -autoreconf --force --install -I config -I m4 - diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 8f5b39f..0000000 --- a/configure.ac +++ /dev/null @@ -1,363 +0,0 @@ -AC_PREREQ(2.13) -# Increment for major API changes, release status changes -m4_define(libxtract_major_version, 0) -# Increment for feature additions and enhancements -m4_define(libxtract_minor_version, 7) -# Increment for fixes -m4_define(libxtract_fix_version, 1) -# Development status -m4_define(libIntegra_dev_status, [beta]) - -m4_define(libxtract_version, libxtract_major_version.libxtract_minor_version.libxtract_fix_version) - -PACKAGE=libxtract - -AC_INIT([libxtract], [libxtract_version], [libxtract-devel@lists.sourceforge.net]) -AC_DEFINE(LIBXTRACT_VERSION, libxtract_version, [LibXtract Version]) -AM_INIT_AUTOMAKE([subdir-objects]) -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_MACRO_DIR([m4]) -AC_PROG_CC -AC_PROG_CXX -AC_PROG_LIBTOOL -AC_PROG_INSTALL -AC_C_BIGENDIAN -AC_PATH_PROG(PKG_CONFIG, pkg-config, no) -AC_ENABLE_STATIC(no) -AC_ENABLE_SHARED(yes) -AC_PROG_LIBTOOL -AC_CHECK_HEADERS([math.h, stdlib.h, stdio.h]) - -dnl DOXYGEN support - -AC_CHECK_PROGS([DOXYGEN], [doxygen]) - -if test -z "$DOXYGEN"; -then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support]) -else - AC_MSG_NOTICE([Doxygen found - continuing with Doxygen support]) -fi - -AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"]) -AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/documentation.doxygen])]) -AC_SUBST(HAVE_DOXYGEN) - -dnl check if we have Accelerate.h - -#AC_CHECK_HEADER(Accelerate/Accelerate.h, [AC_DEFINE(HAVE_ACCELERATE, 1, [Accelerate framework])], [AC_DEFINE(HAVE_ACCELERATE, 0, [Accelerate framework])]) -AC_CHECK_HEADER(Accelerate/Accelerate.h, [use_ooura=false], [use_ooura=true]) - - - - -dnl if [[ "$have_accelerate" = "true" ]] ; then - dnl AC_DEFINE([HAVE_ACCELERATE], [1], [Accelerate headers]) -dnl fi - -dnl --enable flags - -AC_ARG_ENABLE(pd_example, - [ --enable-pd_example Compile the Pure Data external example], - [case "${enableval}" in - yes) pd_example=true ;; - no) pd_example=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-pd_external) ;; - esac],[pd_example=false]) - -AC_ARG_ENABLE(simpletest, - [ --enable-simpletest Compile the 'simpletest' example], - [case "${enableval}" in - yes) simpletest=true ;; - no) simpletest=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-simpletest) ;; - esac],[simpletest=false]) - -# libtool version: current:revision:age -# -# If the library source code has changed at all since the last update, then -# increment revision (`c:r:a' becomes `c:r+1:a'). -# -# If any interfaces have been added, removed, or changed since the last update, -# increment current, and set revision to 0. -# -# If any interfaces have been added since the last public release, then -# increment age. -# -# If any interfaces have been removed since the last public release, then set -# age to 0. -XTRACT_SO_VERSION=0:0:0 - -CFLAGS="-pedantic -ansi -fno-strict-aliasing -Wall -std=c99 -I/usr/local/include" -LDFLAGS="$LDFLAGS -lm" - -AC_ARG_WITH(ooura, - [ --with-ooura compile with ooura fft backend ], - [ - with_ooura="$withval" - ]) - -if [[ "$with_ooura" = "yes" ]] ; then - use_ooura=true -fi - -if [[ "$use_ooura" = "true" ]] ; then - AC_DEFINE([USE_OOURA], [1], [Use the Ooura fft backend]) -fi - -AM_CONDITIONAL([BUILD_OOURA], test "x$use_ooura" = 'xtrue') -AC_SUBST(BUILD_OOURA) - -AC_ARG_WITH(pd_dir, - [ --with-pd-dir=path pd header path (default=/usr/local/include) ], - [ - CFLAGS+=" -I$withval" - echo - echo "pd dir is $withval" - echo - ]) - -dnl set a specific java compiler -AC_ARG_WITH(javac, - [ --with-javac=compiler set a specific java compiler (determined automatically if not set) ], - [JAVAC="$withval" - echo - echo "JAVAC is set to $withval" - echo - ]) - -dnl If --enable-swig, make with java bindings -AC_ARG_WITH(java, - [ --with-java=no If --enable-swig - make with java bindings (default=no) ], - [with_java=true - ]) - -AM_CONDITIONAL(BUILD_JAVA, test "x${with_java}" = 'xtrue') - -dnl If --enable-swig, make with java bindings -AC_ARG_WITH(python, - [ --with-python If --enable-swig - make with python bindings (default=no) ], [with_python=true]) - -AM_CONDITIONAL(BUILD_PYTHON, test "x${with_python}" = 'xtrue') - -dnl are we building the simpletest example -if [[ "$simpletest" = "true" ]] ; then - AC_DEFINE([BUILD_SIMPLETEST], [1], [Build the simpletest example]) -fi - -AM_CONDITIONAL(BUILD_SIMPLETEST, test "x${simpletest}" = 'xtrue') - -dnl Are we building the PD examples? -if [[ "$pd_example" = "true" ]] ; then - PD_SOURCES="xtract~.c" - AC_DEFINE([BUILD_PD_EXAMPLE], [1], [Build the pd example]) - AC_CHECK_HEADER(m_pd.h, [have_pd_hdr=yes ], [ - have_pd_hdr=no - echo - echo "no m_pd.h header found. try with option --with-pd-dir=/path/to/pd/src" - echo - exit - ]) -fi - -AM_CONDITIONAL(BUILD_PD_EXAMPLE, test "x${pd_example}" = 'xtrue') - - -dnl Enable debugging (no) -AC_ARG_ENABLE(debug, - [ --enable-debug[[=value]] compile with debug [[default=no]]], - with_debug="yes", - with_debug="no") -if test "$with_debug" = "yes" -then - AC_DEFINE(DEBUG,1,[Define to enable debug]) - CFLAGS+=" -O0 -ggdb -g -Werror" -else - CFLAGS+=" -O3" -fi - -AC_ARG_ENABLE(swig, - [ --enable-swig Generate swig bindings], - [case "${enableval}" in - yes) swig=true ;; - no) swig=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-swig) ;; - esac],[swig=false]) - - - -if [[ "$with_java" = "true" ]] ; then - if test "$JAVAC" = "" - then - AC_PROG_JAVAC - fi - if test "$JAVAC" = "javac" - then - AC_JNI_INCLUDE_DIR - - for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS - do - CFLAGS+=" -I$JNI_INCLUDE_DIR" - done - fi - dnl AC_PROG_JAVAH - dnl AC_PATH_PROG(JAVAH,javah) -fi - -if [[ "$with_python" = "true" ]] ; then - AM_PATH_PYTHON - SWIG_PYTHON -fi - - -AM_CONDITIONAL(BUILD_SWIG, test "x${swig}" = 'xtrue') - -dnl SWIG stuff -if [[ "$swig" = "true" ]] ; then - AX_PKG_SWIG(1.3.21, [], [ AC_MSG_ERROR([SWIG is not installed]) ]) - AC_DEFINE([BUILD_SWIG], [1], [Build the swig bindings]) -fi - -dnl Check for architecture endian-ness -#AC_C_BIGENDIAN(bigendian=true, bigendian=false, bigendian=undefined) -#if [[ "$is_bigendian" = "false" ]] ; then -# AC_DEFINE([WORDS_BIGENDIAN], [0], [Architecture is big endian]) -#else -# AC_DEFINE([WORDS_BIGENDIAN], [1], [Architecture is not big endian]) -#fi - - -dnl ------------------------------------------ -dnl ---- do some magic to gues the host opsys -dnl ---- taken from libvorbis configure.in -dnl ------------------------------------------ -dnl AC_CANONICAL_HOST - -dnl AC_SUBST(PD_CFLAGS,"$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1") -dnl AC_SUBST(PD_LDFLAGS,"$PD_LDFLAGS -shared") -dnl pd_ldflags="$PD_LDFLAGS -L/usr/local/lib -ldl" -if test -z "$GCC"; then - case $host in - *-*-irix*) - dnl If we're on IRIX, we wanna use cc even if gcc - dnl is there (unless the user has overriden us)... - if test -z "$CC"; then - CC=cc - fi - ;; - sparc-sun-solaris*) - PD_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92" - ;; - *) - PD_CFLAGS="-O" - ;; - esac -else - - case $host in - *86-*-linux*) - PD_CFLAGS+=" -DUNIX -Wall -Wimplicit -Wunused" - PD_LDFLAGS+=" -shared" - dnl we could test for bad glibc here, but don't - PD_SUFFIX=pd_linux - ;; - powerpc-*-linux*) - PD_CFLAGS+=" -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" - PD_LDFLAGS+=" -shared" - PD_SUFFIX=pd_linux - ;; - *-*-linux*) - PD_CFLAGS+=" -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -fPIC" - PD_LDFLAGS+=" -shared -export_dynamic -undefined dynamic_lookup" - PD_SUFFIX=pd_linux - ;; - sparc-sun-*) - echo "YOU HAVE A SPARC STATION, not setting any flags, not supported yet" - ;; - dnl *86-*-darwin*) - dnl PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" - dnl PD_LDFLAGS="$PD_LDFLAGS -dynamiclib -mmacosx-version-min=10.5 -undefined dynamic_lookup -single_module" - dnl PD_SUFFIX=pd_darwin - dnl ;; - *-*-darwin*) - PD_CFLAGS+=" -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" - PD_LDFLAGS+=" -bundle -undefined dynamic_lookup -flat_namespace" - PD_SUFFIX=pd_darwin - ;; - - *) - dnl assume unix - PD_CFLAGS+=" -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1" - PD_LDFLAGS+=" -shared" - PD_SUFFIX=pd_linux - ;; - esac -fi - -PD_CFLAGS+=" -DPD" - -AC_SUBST(PD_CFLAGS) -AC_SUBST(PD_LDFLAGS) -AC_SUBST(PD_SUFFIX) -AC_SUBST(PD_SOURCES) - -AC_CONFIG_FILES([libxtract.pc]) - -dnl There must be a better way to do this... -AC_OUTPUT(Makefile src/Makefile doc/Makefile xtract/Makefile examples/Makefile examples/puredata/Makefile examples/simpletest/Makefile swig/Makefile swig/python/Makefile swig/java/Makefile) - -echo -echo "**************************************************************" -echo -echo "Summary:" -echo -dnl echo you are using the ${host} architecture - - -if test -z "$DOXYGEN"; then - echo "doxygen documentation: no (doxygen not found)" -else - echo "doxygen documentation: yes" -fi -if test "$simpletest" = "true"; then - echo "simpletest example: yes" -else - echo "simpletest example: no" -fi -if test "$pd_example" = "true"; then - echo "PD external: yes" - echo - echo "The PD help files will be installed in:" - echo ${prefix}"/lib/doc/5.reference/xtract/" - echo "You must make sure that this is in your PD help path" -else - echo "PD external: no" -fi -if test "$swig" == "true"; then - echo "SWIG bindings: yes" -else - echo "SWIG bindings: no" -fi -if test "$with_java" == "true"; then - echo "with JAVA module: yes" -else - echo "with JAVA module: no" -fi -if test "$with_python" == "true"; then - echo "with Python module: yes" -else - echo "with Python module: no" -fi -if test "$use_ooura" == "true"; then - echo "Ooura FFT backend: yes" -else - echo "Accelerate FFT backend: yes" -fi - - -echo -echo "**************************************************************" -echo -echo Configuration completed successfully. Type \'make\' to build ${PACKAGE} -echo - - diff --git a/doc/documentation.doxygen.in b/doc/Doxyfile index 6e4d48c..e079aac 100644 --- a/doc/documentation.doxygen.in +++ b/doc/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = LibXtract # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = @PACKAGE_VERSION@ +PROJECT_NUMBER = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. @@ -477,8 +477,7 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = @top_srcdir@/xtract -#INPUT = +INPUT = ../include/xtract # This tag can be used to specify the character encoding of the source files that # doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000..048d758 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,6 @@ + +all: + @$(shell (cat Doxyfile; echo "PROJECT_NUMBER=$(XTRACT_VERSION)") | doxygen - ) + +clean: + @$(RM) -r latex html diff --git a/doc/Makefile.am b/doc/Makefile.am deleted file mode 100644 index 560a006..0000000 --- a/doc/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -MAINTAINERCLEANFILES=Makefile.in config.log -if HAVE_DOXYGEN -CLEANFILES=doxygen-build.stamp - -DOX=documentation.doxygen - -INSTIMAGES=html/doxygen.png - -DOC_STAMPS=html-build.stamp - -DOC_DIR=$(HTML_DIR) - -all-local: doxygen-build.stamp - -doxygen-build.stamp: $(DOX) ../xtract/libxtract.h ../xtract/xtract_scalar.h ../xtract/xtract_vector.h - @echo '*** Running doxygen ***' - doxygen $(DOX) - touch doxygen-build.stamp - -clean-local: - rm -f *~ *.bak $(DOC_STAMPS) || true - if test -d html; then rm -fr html; fi - if test -d latex; then rm -fr latex; fi - if test -d man; then rm -fr man; fi - -distclean-local: clean - rm -f *.stamp || true - if test -d html; then rm -rf html; fi - -endif diff --git a/examples/MSP/Info.plist b/examples/MSP/Info.plist deleted file mode 100644 index 9a02ed6..0000000 --- a/examples/MSP/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleExecutable</key> - <string>xtract~</string> - <key>CFBundleIconFile</key> - <string></string> - <key>CFBundleIdentifier</key> - <string>co.uk.postlude</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundlePackageType</key> - <string>iLaX</string> - <key>CFBundleSignature</key> - <string>max2</string> - <key>CFBundleVersion</key> - <string>1.0</string> - <key>CSResourcesFileMapped</key> - <true/> -</dict> -</plist> diff --git a/examples/MSP/Makefile b/examples/MSP/Makefile deleted file mode 100644 index bb3fbb4..0000000 --- a/examples/MSP/Makefile +++ /dev/null @@ -1,59 +0,0 @@ -NAME=xtract~
-CSYM=xtract~
-
-all: universal
-current: universal
-
-FRAMEWORKS = /Library/Frameworks
-MAXINCLUDE = $(FRAMEWORKS)/MaxAPI.framework/Headers
-MSPINCLUDE = $(FRAMEWORKS)/MaxAudioAPI.framework/Headers
-INSTALLDIR = /Applications/Max5/Cycling\ \'74/externals/
-XTRACT_HEADERS = /usr/local/include
-
-LIPO = /usr/bin/lipo
-CC = gcc
-
-#DEBUG_FLAGS = -Werror -Wall
-
-CFLAGS = -F$(FRAMEWORKS) -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -x c -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -Os -fmessage-length=0 -I$(MAXINCLUDE) -I$(MSPINCLUDE) $(DEBUG_FLAGS) -I$(XTRACT_HEADERS)
-
-I386CFLAGS = -arch i386
-IX86_64CFLAGS = -arch x86_64
-
-LDFLAGS = -F$(FRAMEWORKS) -L$(MAXINCLUDE) -L$(MSPINCLUDE) -framework Carbon -framework MaxAPI -framework MaxAudioAPI -Wl,-Y,1455 -bundle -L/usr/local/lib -lxtract
-
-I386LDFLAGS = -arch i386
-IX86_64CFLAGS = -arch x86_64
-
-universal:
- $(CC) $(CFLAGS) $(I386CFLAGS) -o $(NAME)-i386.o -c $(NAME).c
- $(CC) $(LDFLAGS) $(I386LDFLAGS) -o $(NAME)-i386 $(NAME)-i386.o
- $(LIPO) -create $(NAME)-i386 -output $(NAME)
- mkdir -p $(NAME).mxo/Contents/MacOS
- cp Info.plist PkgInfo $(NAME).mxo/Contents/
- cp $(NAME) $(NAME).mxo/Contents/MacOS
-
-
-intel:
- $(CC) $(CFLAGS) $(I386CFLAGS) -o $(NAME)-i386.o -c $(NAME).c
- $(CC) $(LDFLAGS) $(I386LDFLAGS) -o $(NAME)-i386 $(NAME)-i386.o
- $(LIPO) -create $(NAME)-i386 -output $(NAME)
- mkdir -p $(NAME).mxo/Contents/MacOS
- cp Info.plist PkgInfo $(NAME).mxo/Contents/
- cp $(NAME) $(NAME).mxo/Contents/MacOS
-
-intel64:
- $(CC) $(CFLAGS) $(IX86_64CFLAGS) -o $(NAME)-64.o -c $(NAME).c
- $(CC) $(LDFLAGS) $(IX86_64LDFLAGS) -o $(NAME)-64 $(NAME)-64.o
- $(LIPO) -create $(NAME)-64 -output $(NAME)
- mkdir -p $(NAME).mxo/Contents/MacOS
- cp Info.plist PkgInfo $(NAME).mxo/Contents/
- cp $(NAME) $(NAME).mxo/Contents/MacOS
-
-
-
-clean:
- rm -rf *64* *i386* xtract~ *.mxo
-
-install:
- $(INSTALL) cp -r $(NAME).mxo $(INSTALLDIR)
diff --git a/examples/MSP/PkgInfo b/examples/MSP/PkgInfo deleted file mode 100644 index 0febb6e..0000000 --- a/examples/MSP/PkgInfo +++ /dev/null @@ -1 +0,0 @@ -iLaXmax2
\ No newline at end of file diff --git a/examples/MSP/test/magspec b/examples/MSP/test/magspec deleted file mode 100644 index 14904f6..0000000 --- a/examples/MSP/test/magspec +++ /dev/null @@ -1 +0,0 @@ -max v2;
#N vpatcher 762 88 1362 488;
#P window setfont "Sans Serif" 9.;
#N out 1;
#P newobj 219 220 33 196617 out 1;
#N in 2;
#P newobj 316 36 25 196617 in 2;
#N in 1;
#P newobj 218 44 25 196617 in 1;
#P newex 218 112 108 196617 wave~ mags 0. 11.61;
#P newex 218 77 101 196617 phasor~ 86.133003;
#P newex 53 119 100 196617 buffer~ mags 11.62;
#P newex 218 146 134 196617 xtract~ irregularity_k 512;
#P connect 4 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 0 0;
#P connect 0 0 6 0;
#P connect 5 0 3 2;
#P pop;
\ No newline at end of file diff --git a/examples/MSP/test/xtract-test.pat b/examples/MSP/test/xtract-test.pat deleted file mode 100644 index 72394bf..0000000 --- a/examples/MSP/test/xtract-test.pat +++ /dev/null @@ -1 +0,0 @@ -max v2;
#N vpatcher 22 65 823 798;
#P origin -203 -11;
#P window setfont "Sans Serif" 9.;
#P newex 154 177 46 196617 / 1000.;
#P newex 19 349 39 196617 noise~;
#P flonum 79 206 88 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 79 180 71 196617 expr log($f1);
#P message 377 385 68 196617 /braun/5 \$1;
#P message 305 385 68 196617 /braun/4 \$1;
#P message 229 385 68 196617 /braun/3 \$1;
#P message 155 386 68 196617 /braun/2 \$1;
#P flonum 657 181 51 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 511 176 51 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 426 179 66 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 334 180 63 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 594 180 55 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 0 378 69 196617 send~ source;
#P newex 425 150 72 196617 r irregularity;
#P newex 508 151 72 196617 r fundamental;
#P newex 656 151 57 196617 r variance;
#P newex 223 151 104 196617 r standard_deviation;
#P newex 593 150 55 196617 r centroid;
#P newex 79 148 55 196617 r kurtosis;
#P newex 332 151 80 196617 r inharmonicity;
#P newex 154 151 61 196617 r skewness;
#N vpatcher 9 59 787 818;
#P window setfont "Sans Serif" 9.;
#P newex 622 460 37 196617 pack f;
#P window linecount 1;
#P newex 213 260 83 196617 receive~ source;
#P newex 213 290 35 196617 *~ 1.;
#P newex 516 261 72 196617 s irregularity;
#P newex 226 390 72 196617 s fundamental;
#P newex 557 514 57 196617 s variance;
#P newex 364 560 104 196617 s standard_deviation;
#P newex 312 444 55 196617 s centroid;
#P newex 183 688 55 196617 s kurtosis;
#P newex 70 468 80 196617 s inharmonicity;
#P newex 7 689 61 196617 s skewness;
#P newex 71 423 95 196617 receive~ spectrum;
#P message 213 426 40 196617 list \$1;
#P newex 70 445 153 196617 xtract~ spectral_inharmonicity;
#P newex 529 403 62 196617 poke~ mags;
#P newex 436 265 27 196617 / 2.;
#P newex 470 207 29 196617 * 2.;
#P newex 555 378 85 196617 count~ 0 1024 1;
#P newex 470 232 111 196617 poly~ magspec vs 512;
#P newex 7 667 134 196617 xtract~ spectral_skewness;
#P newex 7 644 95 196617 receive~ spectrum;
#P newex 408 337 44 196617 pack f f;
#P newex 183 667 128 196617 xtract~ spectral_kurtosis;
#P newex 183 644 95 196617 receive~ spectrum;
#P newex 301 559 44 196617 pack f f;
#P newex 333 513 95 196617 receive~ spectrum;
#P message 502 514 40 196617 list \$1;
#P newex 335 533 177 196617 xtract~ spectral_standard_deviation;
#P newex 502 467 95 196617 receive~ spectrum;
#P newex 442 403 81 196617 send~ spectrum;
#P newex 502 488 130 196617 xtract~ spectral_variance;
#P newex 213 360 58 196617 xtract~ f0;
#P newex 394 234 47 196617 * 1000.;
#P newex 394 212 31 196617 !/ 0.;
#P newex 324 80 27 196617 i 10;
#P newex 304 57 30 196617 t b b;
#P newex 304 35 48 196617 loadbang;
#P newex 318 169 27 196617 / 0.;
#P newex 301 326 27 196617 *~;
#P newex 318 274 46 196617 phasor~;
#P newex 318 298 87 196617 wave~ hann 0. 0.;
#P newex 304 130 54 196617 dspstate~;
#P newex 324 103 73 196617 adstatus sigvs;
#B color 5;
#P newex 301 405 128 196617 xtract~ spectral_centroid;
#P newex 301 360 117 196617 xtract~ spectrum 1024;
#P comment 406 300 109 196617 //windowing function;
#P window linecount 0;
#P comment 46 52 100 196617 //basic feature cascade;
#P comment 596 233 100 196617 //poly~ used to reduce down to half-block size to get just magnitudes;
#P comment 598 406 140 196617 //mags is inside the poly~;
#P connect 28 0 29 0;
#P connect 29 0 38 0;
#P connect 37 0 35 0;
#P connect 35 0 39 0;
#P connect 24 0 29 1;
#P connect 25 0 26 0;
#P connect 26 0 40 0;
#P connect 47 0 46 0;
#P connect 46 0 17 0;
#P connect 17 0 36 0;
#P connect 36 0 35 1;
#P connect 17 0 44 0;
#P connect 46 0 10 0;
#P connect 10 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 24 0;
#P connect 24 0 26 1;
#P connect 12 0 13 0;
#P connect 13 0 7 0;
#P connect 5 0 41 0;
#P connect 7 1 11 0;
#P connect 11 0 9 0;
#P connect 9 0 8 0;
#P connect 8 0 10 1;
#P connect 13 1 14 0;
#P connect 14 0 6 0;
#P connect 7 3 11 1;
#P connect 23 0 21 0;
#P connect 21 0 24 1;
#P connect 21 0 42 0;
#P connect 7 1 15 0;
#P connect 15 0 16 0;
#P connect 16 0 8 2;
#P connect 11 0 27 0;
#P connect 27 0 4 1;
#P connect 7 3 15 1;
#P connect 16 0 33 0;
#P connect 4 0 19 0;
#P connect 11 0 32 0;
#P connect 32 0 30 0;
#P connect 20 0 18 0;
#P connect 18 0 22 0;
#P connect 22 0 21 1;
#P connect 30 0 45 0;
#P connect 4 0 34 0;
#P connect 31 0 34 1;
#P connect 18 0 43 0;
#P connect 33 0 30 1;
#P connect 5 0 48 0;
#P connect 48 0 18 1;
#P pop;
#P newobj 594 83 37 196617 p guts;
#P newex 0 269 38 196617 * 100;
#P slider 0 116 15 128 0 1;
#P number 0 294 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 79 386 68 196617 /braun/1 \$1;
#P newex 79 476 120 196617 udpsend 127.0.0.1 4444;
#N vpatcher 10 59 364 406;
#P window setfont "Sans Serif" 9.;
#P newex 47 33 48 196617 loadbang;
#P window linecount 1;
#P newex 87 102 27 196617 t i i;
#P newex 87 258 43 196617 pack i f;
#P newex 87 80 27 196617 - 1;
#P newex 47 59 51 196617 Uzi 1024;
#P newex 87 283 59 196617 peek~ hann;
#P newex 120 227 38 196617 + 0.5;
#P newex 120 206 42 196617 * -0.5;
#P newex 104 126 46 196617 / 1023.;
#P newex 120 161 47 196617 * 6.283;
#P newex 120 183 23 196617 cos;
#P window linecount 0;
#P comment 182 38 100 196617 //makes a hanning window in a buffer called hann;
#P connect 11 0 7 0;
#P connect 7 2 8 0;
#P connect 8 0 10 0;
#P connect 10 0 9 0;
#P connect 9 0 6 0;
#P connect 10 1 3 0;
#P connect 3 0 2 0;
#P connect 2 0 1 0;
#P connect 1 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 9 1;
#P pop;
#P newobj 550 35 80 196617 p make_hanning;
#P newex 533 57 97 196617 buffer~ hann 23.22;
#P user ezdac~ 648 37 692 70 0;
#P newex 0 321 55 196617 saw~ 440;
#P connect 7 0 8 0;
#P connect 8 0 6 0;
#P connect 6 0 0 0;
#P connect 0 0 18 0;
#P connect 30 0 18 0;
#P connect 12 0 28 0;
#P connect 28 0 29 0;
#P connect 28 0 5 0;
#P connect 27 0 4 0;
#P connect 26 0 4 0;
#P connect 25 0 4 0;
#P connect 24 0 4 0;
#P connect 5 0 4 0;
#P connect 10 0 31 0;
#P connect 11 0 24 0;
#P connect 17 0 25 0;
#P connect 16 0 26 0;
#P connect 11 0 20 0;
#P connect 13 0 27 0;
#P connect 17 0 21 0;
#P connect 16 0 22 0;
#P connect 13 0 19 0;
#P connect 15 0 23 0;
#P pop;
\ No newline at end of file diff --git a/examples/MSP/version.plist b/examples/MSP/version.plist deleted file mode 100644 index 169b5fa..0000000 --- a/examples/MSP/version.plist +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>BuildVersion</key> - <string>38</string> - <key>CFBundleShortVersionString</key> - <string>1.0</string> - <key>CFBundleVersion</key> - <string>1.0</string> - <key>ProjectName</key> - <string>CarbonProjectTemplates</string> - <key>SourceVersion</key> - <string>140000</string> -</dict> -</plist> diff --git a/examples/MSP/xtract~.c b/examples/MSP/xtract~.c deleted file mode 100644 index e46ec6a..0000000 --- a/examples/MSP/xtract~.c +++ /dev/null @@ -1,337 +0,0 @@ -/* - * Copyright (C) 2012 Jamie Bullock - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - * - */ - -/* calculates the spectral xtract of one frame, given peak frequency and amplitude to first and second inputs respectively */ - -#include "ext.h" -#include "z_dsp.h" -#include <math.h> -#include <string.h> - -#include "xtract/libxtract.h" - -#define BLOCKSIZE 1024 /* FIX: this should be dynamic - somehow */ -#define NYQUIST 22050.0f - -void *xtract_tilde_class; - -/* Struct for keeping track of memory allocations */ -typedef struct _tracked_memory { - char argv; -} tracked_memory; - -typedef struct _xtract { - t_pxobject x_obj; - void *outlet; /*Float outlet */ - t_float f; - t_int feature; - t_symbol *feature_name; - t_int init_blocksize; - t_int done_init; - t_int feature_type; - tracked_memory memory; - void *argv; - double *data; - double *result; -} t_xtract_tilde; - -static t_int *xtract_perform(t_int *w) { - t_float *in = (t_float *)(w[1]); - t_xtract_tilde *x = (t_xtract_tilde *)(w[2]); - t_int N = (t_int)(w[3]); - t_int return_code = 0; - double result = 0.f; - - for(n = 0; n < N; ++n){ - x->data[n] = (double)in[n]; - } - - return_code = xtract[x->feature](x->data, N, x->argv, &result); - - if(return_code == XTRACT_FEATURE_NOT_IMPLEMENTED) - perror("Feature not implemented"); - - /* set nan, inf or -inf to 0 */ - result = (isinf(result) || isnan(result) ? 0 : result); - - outlet_float(x->outlet, (float)result); - return (w+4); -} - -static t_int *xtract_perform_vector(t_int *w) { - t_sample *in = (t_float *)(w[1]); - t_sample *out = (t_float *)(w[2]); - t_xtract_tilde *x = (t_xtract_tilde *)(w[3]); - t_int N = (t_int)(w[4]), n; - t_int return_code = 0; - - if(x->feature == XTRACT_PEAK_SPECTRUM) - N >>= 1; - - if(N != x->init_blocksize && x->done_init){ - post("xtract~ %s: Blocksize mismatch, try specifying the blocksize as a second argument", x->feature_name->s_name); - return (w+5); - } - - for(n = 0; n < N; ++n){ - x->data[n] = (double)in[n]; - } - - return_code = xtract[x->feature](x->data, N, x->argv, x->result); - - for(n = 0; n < N; ++n){ - out[n] = (float)x->result[n]; - } - - if(return_code == XTRACT_FEATURE_NOT_IMPLEMENTED) - perror("Feature not implemented"); - - return (w+5); -} - -static void xtract_tilde_dsp(t_xtract_tilde *x, t_signal **sp) { - - if(x->feature_type == XTRACT_VECTOR) - dsp_add(xtract_perform_vector, 4, - sp[0]->s_vec, sp[1]->s_vec, x, sp[0]->s_n); - - else dsp_add(xtract_perform, 3, sp[0]->s_vec, x, sp[0]->s_n); - -} - -static void *xtract_tilde_new(t_symbol *me, t_int argc, t_atom *argv) { - - t_symbol *tmp; - t_xtract_tilde *x = (t_xtract_tilde *)newobject(xtract_tilde_class); - xtract_mel_filter *mf; - t_int n, N, f, F, n_args, type; - t_float *argv_max; - xtract_function_descriptor_t *fd; - char *p_name, *p_desc, *author; - int year; - - tmp = NULL; - p_name = p_desc = author = NULL; - - n_args = type = x->feature = 0; - - f = F = XTRACT_FEATURES; - - N = BLOCKSIZE; - - x->argv = NULL; - x->done_init = 0; - - x->data = (double *)getbytes(N * sizeof(double)); - x->result = (double *)getbytes(N * sizeof(double)); - - - if(argc) - tmp = argv[0].a_w.w_sym; /*atom_getsymbol(argv); */ - if(argc > 1) - N = (t_int)argv[1].a_w.w_long; - - x->init_blocksize = N; - - /* get function descriptors */ - fd = (xtract_function_descriptor_t *)xtract_make_descriptors(); - - /* iterate over descriptors */ - while(f--){ - /* map creation arg to feature */ - if(tmp == gensym(fd[f].algo.name)){ - x->feature = f; - break; - } - } - - /* allocate memory for feature arguments */ - n_args = fd[f].argc; - type = fd[f].argv.type; - - if(n_args){ - for(n = 0; n < n_args; n++){ - argv_max = &fd[f].argv.max[n]; - //post("Argument %d, max: %.2f", n, *argv_max); - } - if(type == XTRACT_MEL_FILTER){ - x->memory.argv = (size_t)(n_args * sizeof(xtract_mel_filter)); - x->argv = (xtract_mel_filter *)getbytes(x->memory.argv); - } - else if(type == XTRACT_INT){ - x->memory.argv = (size_t)(n_args * sizeof(t_int)); - x->argv = (t_int *)getbytes(x->memory.argv); - } - else if (type == XTRACT_FLOAT){ - x->memory.argv = (size_t)(n_args * sizeof(t_float)); - x->argv = (t_float *)getbytes(x->memory.argv); - } - else - x->memory.argv = 0; - } - - - p_name = fd[f].algo.p_name; - p_desc = fd[f].algo.p_desc; - author = fd[f].algo.author; - year = fd[f].algo.year; - - if(argc){ - if(strcmp(p_name, "")) - post("xtract~: %s", p_name ); - if(strcmp(p_desc, "")) - post("xtract~: %s", p_desc ); - if(strcmp(author, "") && year) - post("xtract~: %s(%d)", author, year); - } - else - post("xtract~: No arguments given"); - - /* do init if needed */ - if(x->feature == XTRACT_MFCC){ - - mf = x->argv; - - mf->n_filters = 20; - - post("xtract~: mfcc: filters = %d", - ((xtract_mel_filter *)x->argv)->n_filters); - mf->filters = - (t_float **)getbytes(mf->n_filters * sizeof(t_float *)); - for(n = 0; n < mf->n_filters; n++) - mf->filters[n] = (float *)getbytes(N * sizeof(float)); - - xtract_init_mfcc(N, NYQUIST, XTRACT_EQUAL_GAIN, 80.0f, - 18000.0f, mf->n_filters, mf->filters); - } - else if(x->feature == XTRACT_BARK_COEFFICIENTS) - xtract_init_bark(N, NYQUIST, x->argv); - - /* Initialise fft_plan if required */ - if(x->feature == XTRACT_AUTOCORRELATION_FFT || - x->feature == XTRACT_SPECTRUM || - x->feature == XTRACT_DCT){ - xtract_init_fft(N, x->feature); - x->done_init = 1; - } - - if(x->feature == XTRACT_AUTOCORRELATION || - x->feature == XTRACT_AUTOCORRELATION_FFT || - x->feature == XTRACT_MFCC || x->feature == XTRACT_AMDF || - x->feature == XTRACT_ASDF|| x->feature == XTRACT_DCT || - x->feature == XTRACT_BARK_COEFFICIENTS || - x->feature == XTRACT_SPECTRUM || - x->feature == XTRACT_PEAK_SPECTRUM || - x->feature == XTRACT_HARMONIC_SPECTRUM) - x->feature_type = XTRACT_VECTOR; - - else if (x->feature == XTRACT_FLUX || x->feature == XTRACT_ATTACK_TIME || - x->feature == XTRACT_DECAY_TIME || x->feature == XTRACT_DELTA) - x->feature_type = XTRACT_DELTA; - - else x->feature_type = XTRACT_SCALAR; - - /* argv through right inlet */ - inlet_new((t_pxobject *)x, "list"); - - /* DSP inlet */ - dsp_setup((t_pxobject *)x, 1); - - - /* if feature is vector, create signal out */ - if(x->feature_type == XTRACT_VECTOR) - outlet_new((t_pxobject *)x, "signal"); - - /* otherwise: float */ - else - x->outlet = floatout((t_pxobject *)x); - - - /* free the function descriptors */ - xtract_free_descriptors(fd); - - return (void *)x; -} - -static void xtract_tilde_get_args(t_xtract_tilde *x, t_symbol *selector, -t_int argc, t_atom *argv) { -/* - if(argc > (t_int)sizeof(x->argv) / - (t_int)sizeof(t_float) || x->argv == NULL) - post("Too many parameters to right inlet"); - else{*/ - - t_float temp = 0.f; - x->argv = getbytes(argc * sizeof(float)); - - while(argc--){ - temp = argv[argc].a_w.w_float; - ((t_float *)x->argv)[argc] = temp; - } - /* }*/ -} - -static void xtract_tilde_show_help(t_xtract_tilde *x, t_symbol *s){ - - int i; - - i = XTRACT_FEATURES; - xtract_function_descriptor_t *fd, *d; - - fd = (xtract_function_descriptor_t *)xtract_make_descriptors(); - post("\nxtract~: Feature List\n"); - - while(i--){ - d = &fd[i]; - post("\t%s", d->algo.name); - } - - xtract_free_descriptors(fd); -} - -static void xtract_tilde_free(t_xtract_tilde *x) { - - if(x->argv != NULL && x->memory.argv) - freebytes(x->argv, x->memory.argv); - freebytes(x->data); - freebytes(x->result); -} - -int main(void) { - - setup((t_messlist **)&xtract_tilde_class, - (method)xtract_tilde_new, - (method)xtract_tilde_free, - sizeof(t_xtract_tilde), - 0L, - A_GIMME, 0); - - addmess((method)xtract_tilde_dsp, "dsp", A_CANT, 0); - addmess((method)xtract_tilde_get_args, "list", A_GIMME, 0); - addmess((method)xtract_tilde_show_help, "help", A_DEFSYM, 0); - dsp_initclass(); - //class_setname("xtract~", "xtract~"); - - return 0; - -} diff --git a/examples/Makefile b/examples/Makefile new file mode 100644 index 0000000..94ae71d --- /dev/null +++ b/examples/Makefile @@ -0,0 +1,14 @@ + +NAME = simpletest + +.PHONY: $(NAME) clean + +$(NAME): + @$(MAKE) -C $@ + +install: + @$(MAKE) -C $(NAME) install + + +clean: + @$(MAKE) -C $(NAME) clean diff --git a/examples/Makefile.am b/examples/Makefile.am deleted file mode 100644 index 46acfbc..0000000 --- a/examples/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -MAINTAINERCLEANFILES = Makefile.in - -if BUILD_PD_EXAMPLE -PUREDATA_DIR = puredata -endif - -if BUILD_SIMPLETEST -SIMPLETEST_DIR = simpletest -endif - -SUBDIRS = $(PUREDATA_DIR) $(SIMPLETEST_DIR) diff --git a/examples/puredata/Makefile.am b/examples/puredata/Makefile.am deleted file mode 100644 index ee594d7..0000000 --- a/examples/puredata/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -MAINTAINERCLEANFILES = Makefile.in - -SUFFIXES = .@PD_SUFFIX@ -PDDIR = $(prefix)/lib/pd -pddir = $(PDDIR) - -## Make and install the shared library. -pdinstalldir = $(pddir)/extra -pdinstallrefdir = $(pddir)/doc/5.reference -pdinstallexpdir = $(pddir)/doc/xtract - -pdinstall_PROGRAMS = xtract.@PD_SUFFIX@ - -xtract_@PD_SUFFIX@_SOURCES = xtract~.c - -pdincludedir = $(pddir)/src - -AM_CFLAGS = @PD_CFLAGS@ -I$(top_srcdir)/src -I$(pdincludedir) -AM_LDFLAGS = @PD_LDFLAGS@ -lxtract -L$(top_builddir)/src/ - -## Install the documentation. - -install: - install -d $(pdinstalldir) - install -m 644 $(top_builddir)/examples/puredata/.libs/xtract.@PD_SUFFIX@ $(pdinstalldir)/xtract~.@PD_SUFFIX@ - install -d $(pddir)/doc/5.reference/xtract - cp xtract/* $(PDDIR)/doc/5.reference/xtract diff --git a/examples/puredata/bark-example.pd b/examples/puredata/bark-example.pd deleted file mode 100644 index e59b232..0000000 --- a/examples/puredata/bark-example.pd +++ /dev/null @@ -1,52 +0,0 @@ -#N canvas 191 188 450 625 10; -#N canvas 0 0 450 300 graph1 0; -#X array bark 26 float 5; -#A 0 0 0 0 0 0 0 0.00450555 0 0 0 0.0906432 0 0 0.154719 0 0.0683638 -0.0384251 0.0569213 0.0220149 0.0976565 0.064886 0.067408 0.0374335 -0.000314513 4.48489e-05 0; -#X coords 0 1 25 -1 200 140 1; -#X restore 236 -233 graph; -#X obj 273 104 xtract~ spectrum 64; -#X obj 272 73 xtract~ windowed 64; -#X obj 272 136 tabsend~ mags; -#N canvas 0 0 450 300 graph2 0; -#X array mags 32 float 5; -#A 0 0.00450555 0.0906432 0.154719 0.0683638 0.0384251 0.0569213 0.0220149 -0.0423353 0.0553211 0.018837 0.046049 0.0530074 0.0144005 0.0165512 -0.0167357 0.00365258 0.000494011 0.000160456 7.35776e-05 3.51928e-05 -3.1222e-05 1.40643e-05 1.18581e-05 8.65756e-06 7.31448e-06 6.333e-06 -2.75085e-06 4.85414e-06 3.08083e-06 2.56348e-06 3.22329e-06 1.50987e-08 -; -#X coords 0 1 31 -1 200 140 1; -#X restore 16 -232 graph; -#N canvas 3 50 450 300 bark 0; -#X obj 364 19 block~ 32; -#X obj 144 160 tabsend~ bark; -#X obj 145 93 tabreceive~ mags; -#X obj 145 118 xtract~ bark_coefficients 32; -#X connect 2 0 3 0; -#X connect 3 0 1 0; -#X restore 271 167 pd bark; -#N canvas 0 0 450 300 graph3 0; -#X array waveform 67 float 5; -#A 0 -0.304942 0 0.304942 0.578981 0.795978 0.938463 0.999999 0.985604 -0.910237 0.795681 0.666471 0.545664 0.451213 0.393581 0.37492 0.389832 -0.427409 0.474038 0.516335 0.543621 0.549513 0.532424 0.495019 0.442906 -0.382948 0.321642 0.2639 0.212453 0.167896 0.129229 0.094662 0.062379 -0.0310556 8.38604e-07 -0.031054 -0.0623773 -0.0946602 -0.129227 -0.167893 --0.212451 -0.263897 -0.321639 -0.382945 -0.442903 -0.495017 -0.532422 --0.549513 -0.543622 -0.516337 -0.474041 -0.427411 -0.389833 -0.37492 --0.393579 -0.451209 -0.545658 -0.666465 -0.795674 -0.910232 -0.985601 --1 -0.938469 -0.795988 -0.578994 -0.304958 -1.67721e-05 0.304926; -#X coords 0 1 66 -1 200 140 1; -#X restore 17 -56 graph; -#X obj 23 135 loadbang; -#X obj 271 47 tabosc4~ waveform; -#X obj 270 21 sig~ 2000; -#X msg 23 165 \; waveform sinesum 64 0.8 0.3 0.3 0.3 0.1 \; waveform -normalize 1; -#X connect 1 0 3 0; -#X connect 2 0 1 0; -#X connect 7 0 10 0; -#X connect 8 0 2 0; -#X connect 9 0 8 0; diff --git a/examples/puredata/harmonic_spectrum.pd b/examples/puredata/harmonic_spectrum.pd deleted file mode 100644 index 9522217..0000000 --- a/examples/puredata/harmonic_spectrum.pd +++ /dev/null @@ -1,108 +0,0 @@ -#N canvas 621 238 587 354 10; -#X obj 82 127 xtract~ spectrum; -#N canvas 6 48 450 300 mag_spectrum 0; -#X obj 260 64 block~ 512; -#N canvas 0 0 450 300 (subpatch) 0; -#X array mag_spectrum 512 float 3; -#A 0 0.0212162 0.0317487 0.0195466 0.00561563 0.0177077 0.0476304 0.0567499 -0.0474959 0.0970338 0.464764 0.096619 0.0562304 0.0238859 0.0221252 -0.0281975 0.0124481 0.0234213 0.0308018 0.0182565 0.0118857 0.0086735 -0.0188852 0.0119291 0.0237176 0.00864544 0.00273517 0.0113407 0.0100331 -0.0382518 0.0213396 0.0296342 0.034342 0.0171451 0.00243189 0.0301973 -0.00739387 0.0278942 0.0198999 0.0173251 0.0225384 0.0042204 0.0186626 -0.0191895 0.0116634 0.00931694 0.00501582 0.012182 0.0301927 0.0167377 -0.0194199 0.0254657 0.0208484 0.0438904 0.030928 0.0123733 0.0220734 -0.0199979 0.028819 0.00481497 0.0136932 0.00975227 0.0256796 0.0157346 -0.040834 0.0247319 0.0333543 0.00981976 0.00128905 0.0108467 0.00859555 -0.00120924 0.0198812 0.00942567 0.0179 0.021585 0.0144289 0.0138407 -0.0259725 0.0088767 0.0189066 0.0241189 0.0123437 0.0110563 0.0110612 -0.0135812 0.0295776 0.00935764 0.00530153 0.0136921 0.00645618 0.00677527 -0.018981 0.00559285 0.0423402 0.012537 0.0196257 0.0107362 0.0244728 -0.0169689 0.00800423 0.0106661 0.00580486 0.00123392 0.0318564 0.00313052 -0.00918496 0.0148799 0.0215053 0.0103284 0.0101435 0.0159162 0.0265488 -0.0149968 0.0144774 0.0127121 0.0210075 0.0136251 0.0246422 0.0150687 -0.0125131 0.0238336 0.0144661 0.00459801 0.0176529 0.0196158 0.00860441 -0.02399 0.0125216 0.0132359 0.0217819 0.0122651 0.0233058 0.00750471 -0.0162637 0.00563749 0.0107775 0.021111 0.0161979 0.00453912 0.0148774 -0.000913515 0.0250208 0.0255661 0.0349255 0.0140773 0.0264259 0.00978363 -0.0128433 0.017953 0.0123747 0.000980419 0.0202137 0.0111122 0.0122572 -0.0150218 0.0198538 0.00786684 0.0152549 0.00976639 0.00464054 0.0141998 -0.00772205 0.016834 0.0153422 0.00997133 0.00674112 0.0190689 0.0255067 -0.0107735 0.0116028 0.0145695 0.0243072 0.0254179 0.00474025 0.00489552 -0.0260339 0.025168 0.0067304 0.0217401 0.00904745 0.0146951 0.0182503 -0.0392981 0.00691688 0.00454291 0.0212321 0.00856008 0.00406878 0.0208133 -0.0184339 0.0295088 0.0299841 0.0114197 0.00718674 0.00452769 0.0230214 -0.00951422 0.0362591 0.011827 0.0228309 0.0272509 0.0168917 0.0301141 -0.0192356 0.0161379 0.0236251 0.0141769 0.0320988 0.0151104 0.0143148 -0.0313421 0.0272517 0.0313192 0.0226451 0.0218267 0.0183534 0.00742306 -0.0236084 0.0220338 0.00740086 0.0283414 0.0325231 0.0465779 0.027643 -0.0240922 0.0164632 0.0113228 0.0164433 0.0194295 0.0161885 0.0152107 -0.0173802 0.024051 0.0108911 0.0118482 0.0144843 0.0158265 0.0159634 -0.0105952 0.0106542 0.0124575 0.0159426 0.0126567 0.00726532 0.0130271 -0.011397 0.00576796 0.0219027 0.0120067 0.0112131 0.0217665 0.028283 -0.00556188 0.0172272 0.0156255 0.00790093 0.00810658 0.0129488 0.0178136 -0.0131554 0.0221222 0.00680469 0.0248362 0.019694 0.00703206 0.0339999 -0.0136595 0.00676699 0.0151537 0.0263812 0.0226784 0.00493732 0.0295971 -0.0212905 0.0360165 0.0220007 0.0306554 0.0132068 0.0143121 0.0110527 -0.00200652 0.0119865 0.029585 0.0195924 0.00423938 0.0292942 0.0235783 -0.0149287 0.0091102 0.0132163 0.00536295 0.0112099 0.0160713 0.0266621 -0.0049689 0.0151439 0.0168654 0.0132658 0.0118611 0.0180696 0.0176023 -0.00712655 0.0239444 0.00829241 0.016034 0.00839455 0.0132304 0.0193391 -0.00969501 0.0108692 0.01659 0.026616 0.029016 0.00760763 0.00869712 -0.013781 0.0124679 0.0153336 0.0169436 0.0151282 0.00582287 0.0252088 -0.010132 0.0144077 0.0172376 0.0138607 0.0192887 0.0162585 0.0250082 -0.0124786 0.0213438 0.0185502 0.00461736 0.0107252 0.0246183 0.0199021 -0.0213024 0.0325369 0.0128834 0.0297772 0.0139391 0.0290136 0.00977331 -0.0293352 0.0223587 0.00683776 0.00774782 0.00868099 0.0177819 0.0501341 -0.0168349 0.0122174 0.0045685 0.00933541 0.0153631 0.0120776 0.0136674 -0.0110695 0.00526424 0.0223792 0.0189218 0.0324813 0.0175627 0.0103907 -0.00722242 0.0192809 0.0222755 0.0144299 0.0189361 0.00997853 0.0065123 -0.0109085 0.00674032 0.0146737 0.0185307 0.0158343 0.0202681 0.00576984 -0.0147357 0.0204028 0.00339465 0.020232 0.00719163 0.0106671 0.0111035 -0.0214937 0.0121637 0.0168017 0.00981358 0.0179859 0.0189836 0.00543421 -0.0183689 0.0268019 0.0143586 0.0221351 0.00688864 0.0237894 0.0253554 -0.02866 0.00769269 0.015072 0.00734027 0.020403 0.0248997 0.0108569 -0.0154023 0.00941389 0.0291191 0.00872522 0.0223672 0.00639403 0.021712 -0.0246656 0.00448177 0.0050129 0.0137407 0.0122352 0.0130276 0.0181434 -0.0239518 0.0052326 0.0193361 0.0226996 0.0202401 0.0208808 0.030179 -0.00866272 0.0413012 0.0268073 0.0105023 0.0168644 0.00408668 0.00292807 -0.0134017 0.0205693 0.0173767 0.0117562 0.00719525 0.00927211 0.027002 -0.0271098 0.0216011 0.00717236 0.0138263 0.00271252 0.0143244 0.00397278 -0.0219117 0.0104727 0.0199572 0.0140881 0.00060853 0.0142593 0.0227859 -0.0109915 0.0209464 0.0273022 0.0140469 0.0104995 0.00597412 0.00458115 -0.0301041 0.00698568 0.0164327 0.0147746 0.0181867 0.0160428 0.00350695 -0.0073609 0.016644 0.0147995 0.014512 0.0058076 0.0198532 0.0114418 -0.0141326 0.0116806 0.0179014 0.0186733 0.0171869 0.0219169 0.0151714 -0.00699651 0.023865 0.0292064 0.00678898 0.0329386 0.0143645 0.0170765 -0.0206896 0.0111348 0.0100621 0.0115056 0.015144 0.00661284 0.00584966 -0.0215877 0.0121954 0.0291166 0.0302916 0.0354529 0.0102541 0.00448918 -0.0112287 0.0154816 0.00960475 0.035809 0.0276429 0.0209137 0.0209784 -300.821; -#X coords 0 1 511 0 200 140 1; -#X restore 125 121 graph; -#X restore 245 43 pd mag_spectrum; -#X obj 82 162 tabsend~ mag_spectrum; -#X obj 244 15 block~ 1024; -#X obj 278 253 xtract~ peak_spectrum; -#X obj 255 277 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; -#X obj 279 224 tabreceive~ mag_spectrum; -#X msg 453 223 list \$1; -#X obj 453 178 samplerate~; -#X obj 58 71 noise~; -#X obj 113 70 osc~ 440; -#X obj 453 198 / 1024; -#X obj 278 277 xtract~ harmonic_spectrum; -#X obj 278 307 print~; -#X obj 453 151 loadbang; -#X connect 0 0 2 0; -#X connect 4 0 12 0; -#X connect 5 0 13 0; -#X connect 6 0 4 0; -#X connect 7 0 4 1; -#X connect 8 0 11 0; -#X connect 9 0 0 0; -#X connect 10 0 0 0; -#X connect 11 0 7 0; -#X connect 12 0 13 0; -#X connect 14 0 8 0; diff --git a/examples/puredata/lpcc-test.pd b/examples/puredata/lpcc-test.pd deleted file mode 100644 index 607e846..0000000 --- a/examples/puredata/lpcc-test.pd +++ /dev/null @@ -1,57 +0,0 @@ -#N canvas 356 233 722 300 10; -#X obj 160 170 xtract~ autocorrelation; -#N canvas 0 0 450 300 graph1 0; -#X array lpcc 16 float 5; -#A 0 0 0 -0.827113 -0.827113 -0.827113 -0.485055 0.314974 0.657032 -0.810476 0.396513 0.0440753 -0.630112 -0.9456 -0.887411 -1.12995 0.596854 -; -#X coords 0 16 15 -16 200 140 1; -#X restore 458 97 graph; -#X obj 149 34 noise~; -#N canvas 9 103 450 300 lpc 0; -#X obj 323 25 block~ 32; -#X obj 140 52 inlet~; -#X obj 140 113 xtract~ lpc; -#N canvas 237 125 450 300 lpcc 0; -#X obj 26 130 xtract~ lpcc; -#N canvas 0 0 450 300 graph1 0; -#X array lpc 16 float 5; -#A 0 -1.03207 -1.03207 -1.03207 -21.8757 -21.8757 -21.8757 -21.8757 --0.391539 -0.391539 -0.391539 -0.391539 0.448536 0.448536 0.448536 -0.448536 0.516603; -#X coords 0 16 15 -16 200 140 1; -#X restore 219 37 graph; -#X obj 23 12 block~ 16; -#X obj 26 51 tabreceive~ lpc; -#X msg 95 107 list 16; -#X obj 24 196 tabsend~ lpcc; -#X obj 95 85 loadbang; -#X connect 0 0 5 0; -#X connect 3 0 0 0; -#X connect 4 0 0 1; -#X connect 6 0 4 0; -#X restore 298 172 pd lpcc; -#X obj 137 220 tabsend~ lpc; -#X obj 139 152 a_blockswap~ 32; -#X connect 1 0 2 0; -#X connect 2 0 5 0; -#X connect 5 0 4 0; -#X restore 160 218 pd lpc; -#X obj 31 52 a_hann 16; -#X obj 31 25 loadbang; -#X obj 98 23 bng 15 250 50 0 empty empty empty 0 -6 0 10 -262144 -1 --1; -#X obj 156 139 *~; -#X obj 27 -41 block~ 16 4; -#X obj 265 81 *~ 0.4; -#X obj 148 87 *~ 0.1; -#X obj 266 46 osc~ 1000; -#X connect 0 0 3 0; -#X connect 2 0 10 0; -#X connect 4 0 7 0; -#X connect 5 0 4 0; -#X connect 6 0 4 0; -#X connect 7 0 0 0; -#X connect 9 0 7 1; -#X connect 10 0 7 1; -#X connect 11 0 9 0; diff --git a/examples/puredata/regression-test.pd b/examples/puredata/regression-test.pd deleted file mode 100644 index daf8e17..0000000 --- a/examples/puredata/regression-test.pd +++ /dev/null @@ -1,84 +0,0 @@ -#N canvas 520 223 894 462 10; -#X obj 168 31 noise~; -#X obj 168 61 xtract~ spectrum; -#X obj 72 106 xtract~ irregularity_j; -#X obj 95 142 xtract~ irregularity_k; -#X obj 112 206 xtract~ tristimulus_1; -#X obj 145 269 xtract~ tristimulus_2; -#X obj 166 327 xtract~ tristimulus_3; -#X obj 315 87 xtract~ spectral_mean; -#X obj 311 140 xtract~ spectral_variance; -#X obj 326 194 xtract~ spectral_standard_deviation; -#X obj 375 245 xtract~ spectral_kurtosis; -#X floatatom 378 281 5 0 0 0 - - -; -#X floatatom 88 252 5 0 0 0 - - -; -#X floatatom 116 317 5 0 0 0 - - -; -#X floatatom 156 376 5 0 0 0 - - -; -#X floatatom 57 197 5 0 0 0 - - -; -#X floatatom 107 179 5 0 0 0 - - -; -#X floatatom 666 292 5 0 0 0 - - -; -#X obj 603 98 xtract~ mean; -#X obj 599 151 xtract~ variance; -#X obj 614 205 xtract~ standard_deviation; -#X obj 663 256 xtract~ kurtosis; -#X obj 430 365 xtract~ smoothness; -#X floatatom 436 400 5 0 0 0 - - -; -#X msg 696 129 list \$1; -#X msg 762 172 list \$1; -#X msg 728 230 list \$1; -#X msg 505 214 list \$1; -#X msg 375 168 list \$1; -#X msg 465 116 list \$1; -#X obj 611 406 xtract~ loudness; -#X floatatom 612 430 5 0 0 0 - - -; -#X obj 649 360 xtract~ inharmonicity; -#X floatatom 658 385 5 0 0 0 - - -; -#X floatatom 750 327 5 0 0 0 - - -; -#X obj 195 404 xtract~ autocorrelation; -#X obj 257 445 xtract~ bark_coefficients; -#X obj 49 437 xtract~ peak_spectrum; -#X obj 486 438 xtract~ mfcc; -#X obj 28 24 block~ 1024; -#X connect 0 0 1 0; -#X connect 0 0 18 0; -#X connect 0 0 19 0; -#X connect 0 0 20 0; -#X connect 0 0 21 0; -#X connect 1 0 2 0; -#X connect 1 0 3 0; -#X connect 1 0 4 0; -#X connect 1 0 7 0; -#X connect 1 0 8 0; -#X connect 1 0 9 0; -#X connect 1 0 10 0; -#X connect 1 0 5 0; -#X connect 1 0 6 0; -#X connect 1 0 22 0; -#X connect 1 0 30 0; -#X connect 1 0 32 0; -#X connect 1 0 35 0; -#X connect 1 0 36 0; -#X connect 1 0 37 0; -#X connect 1 0 38 0; -#X connect 2 0 15 0; -#X connect 3 0 16 0; -#X connect 4 0 12 0; -#X connect 5 0 13 0; -#X connect 6 0 14 0; -#X connect 7 0 29 0; -#X connect 8 0 28 0; -#X connect 9 0 27 0; -#X connect 10 0 11 0; -#X connect 18 0 24 0; -#X connect 19 0 25 0; -#X connect 20 0 26 0; -#X connect 21 0 17 0; -#X connect 22 0 23 0; -#X connect 24 0 19 1; -#X connect 25 0 20 1; -#X connect 26 0 21 1; -#X connect 27 0 10 1; -#X connect 28 0 9 1; -#X connect 29 0 8 1; -#X connect 30 0 31 0; -#X connect 32 0 33 0; diff --git a/examples/puredata/simple-example.pd b/examples/puredata/simple-example.pd deleted file mode 100644 index 80e8761..0000000 --- a/examples/puredata/simple-example.pd +++ /dev/null @@ -1,26 +0,0 @@ -#N canvas 5 48 450 300 10; -#X obj 154 42 osc~ 440; -#X floatatom 154 180 8 0 0 0 - - -; -#N canvas 619 86 450 300 spectral_mean 1; -#X obj 144 80 xtract~ spectrum; -#X obj 346 21 block~ 1024; -#X obj 145 47 inlet~; -#X obj 145 190 outlet; -#X obj 145 129 xtract~ spectral_centroid; -#X msg 269 57 list \$1; -#X msg 270 11 44100; -#X obj 270 33 / 1024; -#X obj 67 130 print~; -#X obj 73 104 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; -#X connect 0 0 4 0; -#X connect 0 0 8 0; -#X connect 2 0 0 0; -#X connect 4 0 3 0; -#X connect 5 0 0 1; -#X connect 6 0 7 0; -#X connect 7 0 5 0; -#X connect 9 0 8 0; -#X restore 154 115 pd spectral_mean; -#X connect 0 0 2 0; -#X connect 2 0 1 0; diff --git a/examples/puredata/simple-test.pd b/examples/puredata/simple-test.pd deleted file mode 100644 index dce728c..0000000 --- a/examples/puredata/simple-test.pd +++ /dev/null @@ -1,8 +0,0 @@ -#N canvas 642 248 670 289 10; -#X obj 192 63 osc~ 440; -#X floatatom 194 187 10 0 0 0 - - -; -#X obj 193 94 *~ 0.3; -#X obj 193 137 xtract~ f0; -#X connect 0 0 2 0; -#X connect 2 0 3 0; -#X connect 3 0 1 0; diff --git a/examples/puredata/spectrum-512-test.pd b/examples/puredata/spectrum-512-test.pd deleted file mode 100644 index fe22e23..0000000 --- a/examples/puredata/spectrum-512-test.pd +++ /dev/null @@ -1,8 +0,0 @@ -#N canvas 5 48 450 300 10; -#X obj 127 77 noise~; -#X obj 262 59 loadbang; -#X msg 262 86 list 86.1328; -#X obj 127 112 xtract~ spectrum 64; -#X connect 0 0 3 0; -#X connect 1 0 2 0; -#X connect 2 0 3 1; diff --git a/examples/puredata/subband_mean.pd b/examples/puredata/subband_mean.pd deleted file mode 100644 index 332b3d2..0000000 --- a/examples/puredata/subband_mean.pd +++ /dev/null @@ -1,102 +0,0 @@ -#N canvas 493 51 587 478 10; -#X obj 82 127 xtract~ spectrum; -#N canvas 6 48 450 300 mag_spectrum 0; -#X obj 260 64 block~ 512; -#N canvas 0 0 450 300 (subpatch) 0; -#X array mag_spectrum 512 float 3; -#A 0 0.0132486 0.0096563 0.0354424 0.0165249 0.0339139 0.0245265 0.0429209 -0.0604935 0.0858024 0.472867 0.131911 0.0710302 0.0320982 0.0389981 -0.0272274 0.015468 0.0195354 0.0195954 0.0188111 0.0207361 0.0166347 -0.00157469 0.02206 0.0104267 0.0070746 0.0295359 0.0121162 0.013655 -0.0102867 0.00591679 0.00586671 0.00641669 0.0105255 0.0120749 0.00294434 -0.013461 0.00875645 0.0157844 0.00649163 0.0150134 0.0135169 0.0191429 -0.0282347 0.0241475 0.0185751 0.00689928 0.022662 0.00670788 0.00318354 -0.00283897 0.0142583 0.017543 0.00907015 0.0164521 0.0223336 0.02503 -0.0121266 0.0170551 0.0284856 0.0271476 0.00775067 0.00155745 0.0197414 -0.0150477 0.0279912 0.0224467 0.00407337 0.00497963 0.000851764 0.0161942 -0.0176389 0.0160251 0.0175218 0.027366 0.00792114 0.0222662 0.0160268 -0.0279591 0.0112953 0.00409087 0.00645786 0.015363 0.0293401 0.0105894 -0.00844756 0.0175758 0.0215718 0.0200431 0.00260135 0.0101493 0.0200218 -0.00456712 0.0278158 0.0215603 0.0262786 0.0129843 0.00468684 0.024167 -0.0149199 0.0101847 0.00482173 0.00959639 0.0325585 0.0291854 0.0138181 -0.0169087 0.0236841 0.0291382 0.0199014 0.00511631 0.00370711 0.0101142 -0.0120038 0.00115485 0.0154999 0.00297503 0.0140602 0.0191407 0.0210018 -0.0322096 0.0224205 0.0206845 0.0191659 0.031921 0.0151202 0.0168541 -0.036274 0.0229901 0.0349309 0.0208622 0.0131437 0.00933729 0.0126362 -0.025394 0.00901058 0.01157 0.0131736 0.00677092 0.0194996 0.0173273 -0.00325973 0.0124627 0.0110635 0.0167556 0.0136908 0.0065692 0.0262649 -0.0225311 0.0235114 0.0197293 0.00282572 0.0240237 0.00657686 0.0173891 -0.0257314 0.012755 0.0217556 0.00329426 0.0158449 0.0240496 0.0106366 -0.022061 0.00708543 0.0209552 0.00957124 0.0102439 0.016452 0.00943987 -0.0137701 0.0165189 0.0184722 0.0335198 0.023159 0.0140537 0.0137668 -0.0249716 0.0252517 0.0222753 0.0196876 0.00917165 0.0231789 0.0223262 -0.0130253 0.0143873 0.0174217 0.0262216 0.0221904 0.00554891 0.0169622 -0.0214176 0.00636145 0.0190085 0.00084364 0.00991013 0.00538487 0.0132557 -0.034742 0.00783582 0.0329481 0.00777087 0.0132578 0.0246518 0.00381398 -0.0136186 0.0101923 0.0105305 0.0135506 0.00659576 0.00948354 0.0244682 -0.00372209 0.0144119 0.00303586 0.0193436 0.0127196 0.0248709 0.0018994 -0.0102549 0.00929058 0.0222578 0.0290115 0.0211259 0.0397477 0.0200812 -0.0044044 0.0132484 0.0407253 0.00666307 0.0303175 0.014019 0.00897817 -0.00528597 0.0267464 0.014286 0.0215917 0.0260188 0.0217563 0.00233073 -0.01223 0.0020918 0.00739707 0.00231818 0.0237471 0.0197745 0.0138808 -0.00300929 0.0166336 0.0104104 0.0131831 0.00639908 0.00556837 0.0145624 -0.00884734 0.023722 0.0139918 0.0214095 0.0136722 0.0246529 0.0212282 -0.0214965 0.0114811 0.0181338 0.0193226 0.0165735 0.0138509 0.0193118 -0.00444871 0.0119447 0.00337634 0.0148758 0.0187246 0.0244031 0.010354 -0.0146917 0.0135728 0.0135919 0.0270935 0.00721325 0.0254225 0.0171227 -0.0239136 0.00854048 0.00875449 0.0127878 0.0253363 0.0114877 0.0122164 -0.0159164 0.0182439 0.0100041 0.00461047 0.0245388 0.0189458 0.00619877 -0.0248993 0.00963699 0.0249874 0.0271515 0.0145729 0.0279523 0.027924 -0.0220959 0.0262779 0.015607 0.00716239 0.012087 0.0337037 0.00516229 -0.0170121 0.0336761 0.00650737 0.00497518 0.02043 0.0105242 0.00488026 -0.0104467 0.00818958 0.00628406 0.0211596 0.0165034 0.0182923 0.0199196 -0.0249672 0.0164662 0.0214767 0.0120562 0.0322599 0.00383154 0.00921745 -0.00146418 0.0356547 0.0103786 0.0165492 0.0304809 0.0131255 0.0167945 -0.00558382 0.0238359 0.0175395 0.00780578 0.0346175 0.00236843 0.0255091 -0.0201751 0.0108775 0.0210824 0.0209226 0.0320313 0.0437274 0.00560051 -0.0344518 0.00791858 0.0208586 0.0286015 0.0248276 0.0237304 0.0412748 -0.0120705 0.0241371 0.00511147 0.0317298 0.0139929 0.028099 0.0103861 -0.00891256 0.00822179 0.016315 0.0248265 0.0213948 0.0239172 0.0166187 -0.0310473 0.0186244 0.0166212 0.0366136 0.0136573 0.0269544 0.010431 -0.0249531 0.0120786 0.0109345 0.0123368 0.0151866 0.0357349 0.00463059 -0.0118539 0.00970646 0.00946582 0.00969734 0.00891857 0.00890028 0.0202631 -0.0215117 0.0111571 0.0250767 0.0209911 0.0198019 0.0093692 0.0131443 -0.00748891 0.024563 0.0247875 0.0230017 0.00794473 0.00888343 0.0217427 -0.0343637 0.0287685 0.00968487 0.0498302 0.0171984 0.0315536 0.00588345 -0.010743 0.0126087 0.0182915 0.00907374 0.00443379 0.0379275 0.023097 -0.0160588 0.00775962 0.0344518 0.0164484 0.0376125 0.0172285 0.0132559 -0.029612 0.0116543 0.0273187 0.023721 0.0046918 0.0172711 0.00766218 -0.0112108 0.0180092 0.0278611 0.0190289 0.0202484 0.0127141 0.0276473 -0.0169104 0.028993 0.00897726 0.00712007 0.0122292 0.00820719 0.0168334 -0.00864513 0.0127985 0.0237389 0.0120437 0.0212306 0.0304613 0.0189116 -0.0197339 0.0212744 0.0151605 0.0141882 0.0195768 0.00291933 0.0358095 -0.0293726 0.0169182 0.0103468 0.0135299 0.0266578 0.0154398 0.00245885 -0.00794718 0.0127344 0.0298125 0.00820393 0.00626316 0.0170656 0.0230811 -0.00259497 0.0173437 0.00922873 0.0205893 0.0209727 0.00431716 0.00870416 -0.00315811 0.0163018 0.0292532 0.0154488 0.0141043 0.0250745 0.00961138 -0.0142033 0.010861 0.0187522 0.0241866 0.016184 0.0184565 0.0162928 -0.011523 0.0141778 0.0157446 0.0228784 0.0380396 0.0176535 0.0102128 -0.0272628 0.0115185 0.0148983 0.0233291 0.00915212 0.0157429 0.0298723 -101.909; -#X coords 0 1 511 0 200 140 1; -#X restore 125 121 graph; -#X restore 245 43 pd mag_spectrum; -#X obj 82 162 tabsend~ mag_spectrum; -#X obj 244 15 block~ 1024; -#X obj 279 224 tabreceive~ mag_spectrum; -#X obj 58 71 noise~; -#X obj 113 70 osc~ 440; -#X obj 278 307 print~; -#X obj 453 188 loadbang; -#X obj 278 266 xtract~ subbands 1024; -#X obj 118 230 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; -#X msg 453 223 list 0 8 0 16; -#X connect 0 0 2 0; -#X connect 4 0 9 0; -#X connect 5 0 0 0; -#X connect 6 0 0 0; -#X connect 8 0 11 0; -#X connect 9 0 7 0; -#X connect 10 0 7 0; -#X connect 11 0 9 1; diff --git a/examples/puredata/subframe-test.pd b/examples/puredata/subframe-test.pd deleted file mode 100644 index df1b0f8..0000000 --- a/examples/puredata/subframe-test.pd +++ /dev/null @@ -1,131 +0,0 @@ -#N canvas 667 51 613 639 10; -#X obj 263 -160 xtract~ subframe windowed 64; -#X obj 473 -126 tabsend~ windowed; -#N canvas 0 0 450 300 (subpatch) 0; -#X array windowed 64 float 5; -#A 0 0 -0.00539658 -0.0365654 -0.0889249 -0.119512 -0.0710801 0.0849429 -0.314014 0.517949 0.575413 0.405857 0.0231818 -0.452978 -0.839845 -0.971146 --0.775526 -0.314544 0.24085 0.684547 0.864859 0.746131 0.414296 0.0268876 --0.264158 -0.377502 -0.324844 -0.185212 -0.0511399 0.0208516 0.0292007 -0.0100387 7.11504e-15 0 0.000585724 -0.0198747 -0.079146 -0.154996 --0.187268 -0.111695 0.0928308 0.373338 0.611529 0.674151 0.482276 0.0628278 --0.447978 -0.856285 -0.995151 -0.80163 -0.347457 0.191996 0.616082 -0.785785 0.677697 0.381243 0.044994 -0.197483 -0.283735 -0.235181 -0.126292 --0.0330596 0.00773548 0.00706581 7.42552e-15; -#X coords 0 1 63 -1 200 140 1; -#X restore 46 -552 graph; -#X obj 264 -125 xtract~ subframe spectrum 64; -#N canvas 0 0 450 300 (subpatch) 0; -#X array sf_mags1 16 float 5; -#A 0 0.00796987 0.144169 0.24068 0.109756 0.00127541 0.000110428 0.000122432 -0.000120516 0.000102996 8.516e-05 6.88438e-05 5.77259e-05 4.7595e-05 -4.13114e-05 3.56295e-05 1.33207e-06; -#X coords 0 1 15 -1 200 140 1; -#X restore 261 -551 graph; -#N canvas 0 0 450 300 (subpatch) 0; -#X array sf_mags2 32 float 5; -#A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00902428 0.143577 0.241043 0.109515 -0.001105 0.000101461 0.000191993 0.000175226 0.000143044 0.000113519 -8.72515e-05 6.69791e-05 4.84639e-05 3.34907e-05 1.99719e-05 2.52196e-07 -; -#X coords 0 1 31 -1 200 140 1; -#X restore 259 -389 graph; -#N canvas 0 0 450 300 (subpatch) 0; -#X array both 35 float 5; -#A 0 0.00796987 0.144169 0.24068 0.109756 0.00127541 0.000110428 0.000122432 -0.000120516 0.000102996 8.516e-05 6.88438e-05 5.77259e-05 4.7595e-05 -4.13114e-05 3.56295e-05 1.33207e-06 0.00902428 0.143577 0.241043 0.109515 -0.001105 0.000101461 0.000191993 0.000175226 0.000143044 0.000113519 -8.72515e-05 6.69791e-05 4.84639e-05 3.34907e-05 1.99719e-05 2.52196e-07 -0 0 0; -#X coords 0 1 34 -1 200 140 1; -#X restore 46 -393 graph; -#N canvas 18 175 447 500 get_mags 0; -#X obj 71 265 +~; -#X obj 72 233 tabreceive~ sf_mags1; -#X obj 221 233 tabreceive~ sf_mags2; -#X obj 101 30 tabsend~ sf_mags1; -#X obj 70 86 tabsend~ temp; -#X obj 69 124 tabreceive~ temp; -#X obj 70 175 tabsend~ sf_mags2; -#X obj 70 302 outlet~; -#X obj 70 -10 inlet~; -#X obj 70 59 a_blockswap~ 64; -#X obj 69 151 a_blockswap~ 32; -#N canvas 0 0 450 300 (subpatch) 0; -#X array temp 16 float 5; -#A 0 0.00902428 0.143577 0.241043 0.109515 0.001105 0.000101461 0.000191993 -0.000175226 0.000143044 0.000113519 8.72515e-05 6.69791e-05 4.84639e-05 -3.34907e-05 1.99719e-05 2.52196e-07; -#X coords 0 1 15 -1 200 140 1; -#X restore 226 -6 graph; -#X connect 0 0 7 0; -#X connect 1 0 0 0; -#X connect 2 0 0 1; -#X connect 5 0 10 0; -#X connect 8 0 3 0; -#X connect 8 0 9 0; -#X connect 9 0 4 0; -#X connect 10 0 6 0; -#X restore 263 -94 pd get_mags; -#N canvas 0 0 450 300 (subpatch) 0; -#X array diff 16 float 5; -#A 0 -0.00105441 0.000592396 -0.000363603 0.000240721 0.00017041 8.96674e-06 --6.95604e-05 -5.47096e-05 -4.00485e-05 -2.83591e-05 -1.84077e-05 -9.25315e-06 --8.68906e-07 7.82074e-06 1.56576e-05 1.07988e-06; -#X coords 0 1 15 -1 200 140 1; -#X restore 46 -234 graph; -#N canvas 6 433 450 300 diff 0; -#X obj 134 136 tabsend~ diff; -#X obj 134 49 tabreceive~ both; -#X obj 135 78 xtract~ difference_vector 32; -#X obj 348 10 block~ 32; -#X connect 1 0 2 0; -#X connect 2 0 0 0; -#X restore 260 -43 pd diff; -#N canvas 3 50 450 300 flux 0; -#X obj 143 17 tabreceive~ diff; -#X obj 371 -13 block~ 16; -#X obj 144 53 xtract~ flux 16; -#X obj 144 90 outlet; -#X connect 0 0 2 0; -#X connect 2 0 3 0; -#X restore 262 -16 pd flux; -#X obj 262 -70 tabsend~ both; -#N canvas 9 100 467 310 source 0; -#X obj 162 -117 noise~; -#X obj 100 -40 *~; -#X obj 105 140 hsl 100 10 0 1 0 0 vol vol-set empty -2 -6 0 10 -204786 --1 -1 9900 1; -#X msg 212 -58 1; -#X obj 115 -94 r vol; -#X obj 161 -40 *~; -#X obj 212 -89 t b f; -#X obj 225 -30 -; -#X obj 101 20 outlet~; -#X text 111 118 noise <-> sine; -#X obj 336 -87 loadbang; -#X obj 100 -115 osc~ 4000; -#X msg 336 -61 \; vol 1 \; vol-set 1; -#X connect 0 0 5 0; -#X connect 1 0 8 0; -#X connect 3 0 7 0; -#X connect 4 0 1 1; -#X connect 4 0 6 0; -#X connect 5 0 8 0; -#X connect 6 0 3 0; -#X connect 6 1 7 1; -#X connect 7 0 5 1; -#X connect 10 0 12 0; -#X connect 11 0 1 0; -#X coords 0 -1 1 1 110 60 1 100 100; -#X restore 263 -231 pd source; -#X floatatom 262 40 5 0 0 0 spectral_flux - -; -#X obj 262 7 a_bavg 128; -#X connect 0 0 1 0; -#X connect 0 0 3 0; -#X connect 3 0 7 0; -#X connect 7 0 11 0; -#X connect 10 0 14 0; -#X connect 12 0 0 0; -#X connect 14 0 13 0; diff --git a/examples/puredata/tonality_from_subbands.pd b/examples/puredata/tonality_from_subbands.pd deleted file mode 100644 index 3665bad..0000000 --- a/examples/puredata/tonality_from_subbands.pd +++ /dev/null @@ -1,160 +0,0 @@ -#N canvas 493 51 587 478 10; -#X obj 82 212 xtract~ spectrum; -#N canvas 9 75 450 300 mag_spectrum 0; -#X obj 260 64 block~ 512; -#N canvas 0 0 450 300 (subpatch) 0; -#X array mag_spectrum 512 float 3; -#A 0 0.00791511 0.00796441 0.00804782 0.00816725 0.00832556 0.00852671 -0.00877601 0.00908054 0.00944968 0.00989593 0.0104362 0.0110935 0.0119005 -0.0129037 0.0141728 0.0158165 0.0180132 0.0210785 0.0256274 0.0330392 -0.0471787 0.0845833 0.462538 0.12868 0.0556718 0.0352146 0.0256003 -0.0200227 0.0163861 0.013831 0.0119397 0.0104852 0.00933302 0.00839885 -0.00762689 0.00697887 0.00642763 0.00595337 0.00554132 0.00518025 0.00486145 -0.00457808 0.00432469 0.00409689 0.00389113 0.00370479 0.00353334 0.00337798 -0.00323515 0.00310359 0.00298209 0.00286958 0.00276511 0.00266788 0.00257719 -0.00249241 0.00241301 0.00233849 0.00226844 0.00220248 0.00214026 0.00208149 -0.00202589 0.00197323 0.00192327 0.00187583 0.00183072 0.00178779 0.00174693 -0.00170751 0.00167039 0.00163477 0.00160066 0.00156795 0.00153673 0.00150668 -0.00147784 0.00145013 0.00142347 0.00139785 0.00137317 0.00134938 0.00132645 -0.00130433 0.00128297 0.00126234 0.0012424 0.00122312 0.00120446 0.0011864 -0.00116891 0.00115197 0.00113544 0.00111958 0.00110411 0.0010891 0.00107452 -0.00106035 0.00104659 0.00103319 0.00102017 0.00100749 0.000995155 -0.000983141 0.000971438 0.000960027 0.000948909 0.000938068 0.000927495 -0.000917176 0.000907107 0.000897275 0.000887676 0.000878296 0.000869136 -0.000860182 0.000851426 0.000842866 0.000834491 0.0008263 0.000818288 -0.000810442 0.000802759 0.000795238 0.000787864 0.00078067 0.000773593 -0.000766665 0.000759872 0.000753206 0.000746684 0.000740281 0.000733997 -0.000727835 0.000721787 0.00071585 0.000710022 0.000704302 0.000698687 -0.000693163 0.000687744 0.00068242 0.000677189 0.000672046 0.000666989 -0.000662008 0.000657152 0.000652346 0.000647625 0.000642983 0.00063827 -0.000633902 0.00062948 0.00062513 0.000620847 0.00061663 0.00061248 -0.000608394 0.000604371 0.00060041 0.000596508 0.000592662 0.000588881 -0.000585149 0.000581476 0.000577854 0.000574287 0.000570768 0.0005673 -0.000563885 0.000560517 0.000557198 0.000553921 0.000550691 0.000547506 -0.000544363 0.00054127 0.000538212 0.000535196 0.000532221 0.000529285 -0.000526391 0.000523531 0.000520713 0.00051793 0.000515163 0.00051246 -0.000509783 0.00050714 0.000504528 0.000501949 0.000499401 0.000496887 -0.000494399 0.000491941 0.000489499 0.000486984 0.000484886 0.00048249 -0.000480167 0.000477879 0.00047517 0.000473408 0.000471204 0.000469028 -0.000466878 0.000464756 0.000462657 0.000460551 0.000458529 0.000456502 -0.000454496 0.000452516 0.000450556 0.000448618 0.000446703 0.000444806 -0.000442933 0.000441081 0.000439249 0.000437435 0.000435644 0.000433869 -0.000432115 0.00043038 0.000428663 0.000426967 0.000425283 0.000423621 -0.000421977 0.000420346 0.000418718 0.000417151 0.000415575 0.000414008 -0.000412461 0.000410933 0.000409421 0.000407924 0.000406438 0.00040497 -0.000403515 0.000402073 0.000400648 0.000399229 0.000397818 0.000396404 -0.000394843 0.000394005 0.000392514 0.000391154 0.000389825 0.000388485 -0.00038723 0.000385942 0.000384692 0.000383438 0.000382193 0.000380966 -0.000379752 0.000378546 0.000377355 0.000376173 0.000375004 0.000373846 -0.000372698 0.000371564 0.000370438 0.000369319 0.000368222 0.000367128 -0.000366044 0.00036497 0.000363896 0.000362854 0.000361811 0.000360777 -0.000359753 0.000358738 0.000357735 0.000356738 0.000355751 0.000354775 -0.000353804 0.000352844 0.000351894 0.000350951 0.000350019 0.000349093 -0.000348178 0.000347267 0.000346367 0.000345476 0.000344592 0.000343716 -0.000342849 0.000341989 0.000341133 0.000340284 0.000339464 0.000338628 -0.000337809 0.000336992 0.000336174 0.000335386 0.000334592 0.000333804 -0.000333026 0.000332255 0.000331489 0.000330732 0.000329979 0.000329234 -0.000328496 0.000327764 0.000327041 0.000326322 0.000325609 0.000324903 -0.000324195 0.000323522 0.000322828 0.000322148 0.000321469 0.000320755 -0.000320146 0.000319485 0.000318837 0.000318193 0.000317549 0.000316917 -0.000316288 0.000315666 0.000315051 0.000314437 0.000313833 0.000313232 -0.000312637 0.000312049 0.000311464 0.000310884 0.000310312 0.000309744 -0.000309181 0.000308621 0.000308068 0.00030752 0.000306974 0.00030644 -0.000305907 0.000305374 0.000304852 0.000304332 0.000303818 0.00030331 -0.000302803 0.000302303 0.000301806 0.000301317 0.000300826 0.000300345 -0.000299868 0.000299394 0.000298923 0.000298458 0.000297995 0.000297538 -0.000297083 0.000296631 0.000296177 0.000295711 0.000295329 0.000294857 -0.000294385 0.000293858 0.00029202 0.00029358 0.000292995 0.000292537 -0.000292112 0.000291698 0.000291297 0.000290902 0.00029051 0.000290124 -0.000289743 0.000289366 0.000288996 0.000288627 0.000288263 0.0002879 -0.000287544 0.000287195 0.000286843 0.000286509 0.000286161 0.000285818 -0.000285489 0.000285158 0.000284832 0.000284511 0.000284184 0.000283871 -0.000283558 0.00028325 0.000282946 0.000282636 0.000282341 0.000282046 -0.000281753 0.000281465 0.000281177 0.000280893 0.000280613 0.000280336 -0.000280061 0.000279788 0.000279522 0.000279243 0.000278967 0.000278676 -0.000278261 0.000278674 0.000278138 0.000277848 0.000277583 0.000277294 -0.000277122 0.000276878 0.000276643 0.000276415 0.000276191 0.000275971 -0.000275756 0.00027554 0.000275331 0.000275124 0.000274919 0.000274721 -0.000274521 0.000274329 0.000274132 0.00027394 0.000273764 0.00027358 -0.000273397 0.000273221 0.000273038 0.000272878 0.000272708 0.000272543 -0.000272381 0.000272217 0.000272063 0.000271911 0.000271758 0.00027161 -0.000271463 0.00027132 0.000271182 0.000271044 0.00027091 0.000270778 -0.000270653 0.000270522 0.0002704 0.000270284 0.000270164 0.000270048 -0.000269937 0.00026983 0.000269723 0.00026963 0.000269475 0.000269405 -0.000269311 0.00026922 0.000269133 0.000269041 0.000268957 0.000268874 -0.000268794 0.000268718 0.000268642 0.00026857 0.000268503 0.000268438 -0.000268366 0.000268309 0.000268254 0.000268193 0.000268139 0.000268089 -0.000268038 0.000268001 0.000267953 0.000267913 0.000267873 0.000267822 -0.000267814 0.000267781 0.000267753 0.000267727 0.000267703 0.000267684 -0.000267668 0.000267654 0.000267642 0.000267632 0.000267626 0.000267624 -0.0751003; -#X coords 0 1 511 0 200 140 1; -#X restore 125 121 graph; -#X restore 245 43 pd mag_spectrum; -#X obj 82 247 tabsend~ mag_spectrum; -#X obj 244 15 block~ 1024; -#X obj 82 46 noise~; -#N canvas 9 100 450 653 tonality 0; -#N canvas 0 0 450 300 (subpatch) 0; -#X array subbands 8 float 5; -#A 0 0.459222 0.00349705 0.00161501 0.00109469 0.000855802 0.000726442 -0.000653362 0; -#X coords 0 1 7 -1 200 140 1; -#X restore 35 -128 graph; -#X obj 60 73 tabreceive~ subbands; -#X obj 366 -129 block~ 8; -#X obj 61 127 xtract~ flatness 8; -#X msg 173 200 list \$1; -#X obj 30 227 xtract~ flatness_db 8; -#X obj 35 283 xtract~ tonality 8; -#X msg 156 257 list \$1; -#X obj 37 353 outlet; -#X connect 1 0 3 0; -#X connect 3 0 4 0; -#X connect 4 0 5 1; -#X connect 5 0 7 0; -#X connect 6 0 8 0; -#X connect 7 0 6 1; -#X restore 282 354 pd tonality; -#X floatatom 282 414 5 0 0 0 - - -; -#X obj 82 186 *~ 0; -#X obj 122 186 *~ 0; -#X obj 144 120 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 -262144 --1 -1 12700 1; -#N canvas 3 50 450 300 xfade 0; -#X obj 183 139 -; -#X obj 183 170 outlet; -#X obj 183 30 inlet; -#X obj 272 175 outlet; -#X obj 183 87 t a a; -#X msg 183 116 1 \$1; -#X obj 183 58 / 127; -#X connect 0 0 1 0; -#X connect 2 0 6 0; -#X connect 4 0 5 0; -#X connect 4 1 3 0; -#X connect 5 0 0 0; -#X connect 6 0 4 0; -#X restore 141 145 pd xfade; -#N canvas 262 411 450 300 subbands 0; -#X obj 89 114 tabreceive~ mag_spectrum; -#X obj 263 78 loadbang; -#X obj 88 197 tabsend~ subbands; -#X obj 362 28 block~ 512; -#X obj 88 156 xtract~ subbands 512; -#X msg 263 113 list 35 8 1 0; -#X connect 0 0 4 0; -#X connect 1 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 1; -#X restore 84 297 pd subbands; -#X obj 122 77 osc~ 1000; -#X connect 0 0 2 0; -#X connect 4 0 7 0; -#X connect 5 0 6 0; -#X connect 7 0 0 0; -#X connect 8 0 0 0; -#X connect 9 0 10 0; -#X connect 10 0 7 1; -#X connect 10 1 8 1; -#X connect 12 0 8 0; diff --git a/examples/puredata/xtract/a_bavg.pd b/examples/puredata/xtract/a_bavg.pd deleted file mode 100644 index 38c8c71..0000000 --- a/examples/puredata/xtract/a_bavg.pd +++ /dev/null @@ -1,36 +0,0 @@ -#N canvas 0 0 450 300 10; -#X obj 140 183 +; -#X obj 243 216 f; -#X obj 242 124 f; -#X obj 275 124 + 1; -#X msg 244 193 0; -#X obj 175 223 f; -#X obj 175 245 / \$1; -#X obj 242 147 % \$1; -#X obj 319 172 f \$1; -#X obj 319 192 - 1; -#X obj 243 170 sel; -#X obj 319 146 loadbang; -#X obj 161 60 inlet; -#X obj 165 84 t b f; -#X obj 175 271 outlet; -#X text 28 12 Averages a series of N numbers where N is given by the -first arument (works in blocks); -#X connect 0 0 1 0; -#X connect 0 0 5 1; -#X connect 1 0 0 1; -#X connect 2 0 3 0; -#X connect 2 0 7 0; -#X connect 3 0 2 1; -#X connect 4 0 1 0; -#X connect 5 0 6 0; -#X connect 6 0 14 0; -#X connect 7 0 10 0; -#X connect 8 0 9 0; -#X connect 9 0 10 1; -#X connect 10 0 4 0; -#X connect 10 0 5 0; -#X connect 11 0 8 0; -#X connect 12 0 13 0; -#X connect 13 0 2 0; -#X connect 13 1 0 0; diff --git a/examples/puredata/xtract/a_blockswap~.pd b/examples/puredata/xtract/a_blockswap~.pd deleted file mode 100644 index 65dbd10..0000000 --- a/examples/puredata/xtract/a_blockswap~.pd +++ /dev/null @@ -1,43 +0,0 @@ -#N canvas 415 243 512 595 10; -#X obj 141 161 samplerate~; -#X obj 141 401 phasor~; -#X obj 23 10 inlet~; -#X obj 140 523 outlet~; -#X obj 141 78 loadbang; -#X text 232 72 Clone of zexy blockswap~; -#X text 232 90 First argument gives block size; -#X obj 245 167 f \$1; -#X obj 245 343 /; -#X obj 141 109 t b b; -#X obj 284 264 / 2; -#X obj 245 265 t b a; -#X obj 245 304 f; -#X obj 245 213 - 1; -#X obj 141 332 / \$1; -#X obj 140 473 *~ \$1; -#X obj 385 4 table \$0-input; -#X obj 23 34 tabsend~ \$0-input; -#X msg 321 315 \; \$1-input resize \$2; -#X obj 321 265 pack \$0 \$1; -#X obj 245 189 t a a b; -#X obj 141 496 tabread~ \$0-input; -#X connect 0 0 14 0; -#X connect 1 0 15 0; -#X connect 2 0 17 0; -#X connect 4 0 9 0; -#X connect 7 0 20 0; -#X connect 8 0 1 1; -#X connect 9 0 0 0; -#X connect 9 1 7 0; -#X connect 10 0 12 1; -#X connect 11 0 12 0; -#X connect 11 1 8 1; -#X connect 12 0 8 0; -#X connect 13 0 11 0; -#X connect 14 0 1 0; -#X connect 15 0 21 0; -#X connect 19 0 18 0; -#X connect 20 0 13 0; -#X connect 20 1 10 0; -#X connect 20 2 19 0; -#X connect 21 0 3 0; diff --git a/examples/puredata/xtract/a_hann.pd b/examples/puredata/xtract/a_hann.pd deleted file mode 100644 index fbc7af4..0000000 --- a/examples/puredata/xtract/a_hann.pd +++ /dev/null @@ -1,30 +0,0 @@ -#N canvas 379 192 709 463 10; -#X obj 381 119 samplerate~; -#X obj 384 187 phasor~; -#X msg 470 117 0; -#X obj 384 216 expr~ 0.5 - cos($v1 * 6.28) * 0.5; -#X obj 381 141 /~ \$1; -#X text 43 20 Creation arg gives window size; -#X obj 346 38 t b b b b; -#X obj 504 92 float \$1; -#X obj 346 10 inlet; -#X msg 504 114 resize \$1; -#X obj 504 139 s \$0-hann; -#X obj 589 37 table \$0-hann; -#X obj 318 296 tabwrite~ \$0-hann; -#X obj 58 186 tabreceive~ \$0-hann; -#X obj 59 229 outlet~; -#X obj 589 11 block~ \$1; -#X connect 0 0 4 0; -#X connect 1 0 3 0; -#X connect 2 0 1 1; -#X connect 3 0 12 0; -#X connect 4 0 1 0; -#X connect 6 0 12 0; -#X connect 6 1 2 0; -#X connect 6 2 0 0; -#X connect 6 3 7 0; -#X connect 7 0 9 0; -#X connect 8 0 6 0; -#X connect 9 0 10 0; -#X connect 13 0 14 0; diff --git a/examples/puredata/xtract/a_mton.pd b/examples/puredata/xtract/a_mton.pd deleted file mode 100644 index 7829dbe..0000000 --- a/examples/puredata/xtract/a_mton.pd +++ /dev/null @@ -1,66 +0,0 @@ -#N canvas 165 175 599 406 10; -#X obj 151 123 inlet; -#X obj 151 179 % 12; -#X obj 151 232 sel 0 1 2 3 4 5 6 7 8 9 10 11; -#X obj 483 268 / 12; -#X obj 483 291 int; -#X obj 483 313 outlet; -#X msg 80 272 C; -#X msg 110 272 C#; -#X msg 142 273 D; -#X msg 174 273 D#; -#X msg 203 273 E; -#X msg 236 274 F; -#X msg 269 274 F#; -#X msg 299 274 G; -#X msg 329 274 G#; -#X msg 359 275 A; -#X msg 393 275 A#; -#X msg 425 275 B; -#X obj 235 342 symbol; -#X obj 235 368 outlet; -#X obj 569 206 int; -#X obj 537 184 t f f; -#X obj 537 207 -; -#X obj 538 313 outlet; -#X text 51 30 a_mton takes midi note number as a float and outputs -note name \, octave and deviation in cents.; -#X obj 537 231 * 100; -#X obj 537 250 - 50; -#X connect 0 0 1 0; -#X connect 0 0 3 0; -#X connect 0 0 21 0; -#X connect 1 0 2 0; -#X connect 2 0 6 0; -#X connect 2 1 7 0; -#X connect 2 2 8 0; -#X connect 2 3 9 0; -#X connect 2 4 10 0; -#X connect 2 5 11 0; -#X connect 2 6 12 0; -#X connect 2 7 13 0; -#X connect 2 8 14 0; -#X connect 2 9 15 0; -#X connect 2 10 16 0; -#X connect 2 11 17 0; -#X connect 3 0 4 0; -#X connect 4 0 5 0; -#X connect 6 0 18 0; -#X connect 7 0 18 0; -#X connect 8 0 18 0; -#X connect 9 0 18 0; -#X connect 10 0 18 0; -#X connect 11 0 18 0; -#X connect 12 0 18 0; -#X connect 13 0 18 0; -#X connect 14 0 18 0; -#X connect 15 0 18 0; -#X connect 16 0 18 0; -#X connect 17 0 18 0; -#X connect 18 0 19 0; -#X connect 20 0 22 1; -#X connect 21 0 22 0; -#X connect 21 1 20 0; -#X connect 22 0 25 0; -#X connect 25 0 26 0; -#X connect 26 0 23 0; diff --git a/examples/puredata/xtract/a_output~.pd b/examples/puredata/xtract/a_output~.pd deleted file mode 100644 index 8cbf956..0000000 --- a/examples/puredata/xtract/a_output~.pd +++ /dev/null @@ -1,71 +0,0 @@ -#N canvas 0 0 757 675 12; -#X obj 516 522 t b; -#X obj 516 469 f; -#X obj 516 547 f; -#X msg 630 546 0; -#X obj 516 499 moses 1; -#X obj 630 518 t b f; -#X obj 596 479 moses 1; -#X obj 29 97 dbtorms; -#X obj 85 170 inlet~; -#X msg 278 300 \; pd dsp 1; -#X obj 29 170 line~; -#X obj 64 242 *~; -#X obj 64 272 dac~; -#X obj 29 127 pack 0 50; -#X text 121 146 audio in; -#X text 301 496 test if less than 1 -->; -#X text 267 523 if true convert to bang -->; -#X text 100 96 <-- convert from dB to linear units; -#X floatatom 31 13 3 0 100 0 dB - -; -#X obj 44 37 bng 15 250 50 0 empty empty mute -38 7 0 10 -262144 -1 --1; -#X text 118 126 <-- make a ramp to avoid clicks or zipper noise; -#X obj 148 170 inlet~; -#X obj 154 241 *~; -#X text 502 399 MUTE logic:; -#X obj 293 247 s \$0-master-out; -#X obj 29 71 r \$0-master-out; -#X obj 596 450 r \$0-master-out; -#X text 182 8 Level control abstraction \, used in many of the Pd example -patches. The level and mute controls show up on the parent \, calling -patch.; -#X text 229 549 previous nonzero master-lvl -->; -#X text 301 453 recall previous; -#X text 301 471 value of master-lvl -->; -#X text 16 310 automatically start DSP -->; -#X obj 85 192 hip~ 3; -#X obj 147 192 hip~ 3; -#X text 26 608 NOTE: This abstraction was written by Miller Puckette -\, and is include with the PD examples as part of the 'standard' PD -documentation. JB 23/05/05; -#X obj 278 193 r \$0-master-lvl-stereo; -#X obj 516 573 s \$0-master-lvl-stereo; -#X obj 623 215 inlet; -#X connect 0 0 2 0; -#X connect 1 0 4 0; -#X connect 2 0 36 0; -#X connect 3 0 36 0; -#X connect 4 0 0 0; -#X connect 4 1 5 0; -#X connect 5 0 3 0; -#X connect 6 1 2 1; -#X connect 7 0 13 0; -#X connect 8 0 32 0; -#X connect 10 0 22 0; -#X connect 10 0 11 0; -#X connect 11 0 12 0; -#X connect 13 0 10 0; -#X connect 18 0 9 0; -#X connect 18 0 24 0; -#X connect 19 0 1 0; -#X connect 21 0 33 0; -#X connect 22 0 12 1; -#X connect 25 0 7 0; -#X connect 26 0 1 1; -#X connect 26 0 6 0; -#X connect 32 0 11 1; -#X connect 33 0 22 1; -#X connect 35 0 18 0; -#X connect 37 0 18 0; -#X coords 0 0 1 1 65 55 1 0 0; diff --git a/examples/puredata/xtract/a_spigot~.pd b/examples/puredata/xtract/a_spigot~.pd deleted file mode 100644 index 86ebd54..0000000 --- a/examples/puredata/xtract/a_spigot~.pd +++ /dev/null @@ -1,21 +0,0 @@ -#N canvas 0 0 450 300 10; -#X obj 153 112 inlet~; -#X obj 152 229 outlet~; -#X obj 153 186 expr~ $v1 * $v2; -#X obj 252 162 line~; -#X msg 258 121 1 20; -#X msg 299 121 0 20; -#X obj 255 14 inlet; -#X obj 255 36 > 0; -#X obj 255 63 select 1 0; -#X text 49 261 Audio spigot. Same behaviour as spigot but for audio -; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 2 1; -#X connect 4 0 3 0; -#X connect 5 0 3 0; -#X connect 6 0 7 0; -#X connect 7 0 8 0; -#X connect 8 0 4 0; -#X connect 8 1 5 0; diff --git a/examples/puredata/xtract/f0.pd b/examples/puredata/xtract/f0.pd deleted file mode 100644 index 6ea0714..0000000 --- a/examples/puredata/xtract/f0.pd +++ /dev/null @@ -1,302 +0,0 @@ -#N canvas 730 93 584 590 10; -#N canvas 162 173 901 522 guts 0; -#X obj 205 48 osc~; -#X obj 338 70 a_spigot~; -#X obj 205 70 a_spigot~; -#X obj 331 -26 line; -#X msg 331 -50 \$1 50; -#X obj 357 282 ftom; -#X obj 3 48 ftom; -#N canvas 0 0 450 300 fm 0; -#X obj 181 114 osc~; -#X obj 138 175 osc~; -#X obj 137 154 +~; -#X obj 144 209 outlet~; -#X obj 182 82 *; -#X obj 137 26 inlet; -#X obj 204 6 inlet; -#X obj 179 54 f; -#X obj 204 30 t b f; -#X obj 182 143 *~; -#X obj 238 81 - 2; -#X obj 225 113 * 100000; -#X connect 0 0 9 0; -#X connect 1 0 3 0; -#X connect 2 0 1 0; -#X connect 4 0 0 0; -#X connect 5 0 2 0; -#X connect 5 0 4 0; -#X connect 5 0 7 1; -#X connect 6 0 8 0; -#X connect 7 0 4 0; -#X connect 7 0 2 0; -#X connect 8 0 7 0; -#X connect 8 1 4 1; -#X connect 8 1 10 0; -#X connect 9 0 2 1; -#X connect 10 0 11 0; -#X connect 11 0 9 1; -#X restore 339 47 pd fm; -#X obj 459 69 a_spigot~; -#X obj 253 168 +~; -#N canvas 0 0 450 300 noise 0; -#X obj 260 126 noise~; -#X obj 269 161 *~; -#X obj 270 194 lop~; -#X obj 305 161 * 10000; -#X obj 320 124 inlet; -#X obj 268 236 outlet~; -#X connect 0 0 1 0; -#X connect 1 0 2 0; -#X connect 2 0 5 0; -#X connect 3 0 2 1; -#X connect 4 0 3 0; -#X connect 4 0 1 1; -#X restore 587 66 pd noise; -#N canvas 554 114 496 580 pda 0; -#X obj 99 100 xtract~ f0; -#X obj 197 6 inlet~; -#X msg 361 203 list \$1; -#X obj 244 115 *~; -#X obj 59 25 r sr; -#X obj 149 267 tabsend~ freqs; -#X obj 401 30 table freqs; -#X obj 148 292 tabreceive~ freqs; -#X obj 6 220 != 0; -#X obj 4 331 spigot; -#X obj 57 331 spigot; -#X obj 67 217 == 0; -#X obj 27 369 f; -#X obj 28 415 lop~ 20; -#X obj 27 393 sig~; -#X obj 29 469 snapshot~; -#X obj 95 434 bang~; -#X obj 26 529 outlet; -#X obj 29 499 a_bavg 4; -#X obj 197 29 lop~ 5000; -#X obj 402 8 block~ 2048; -#X obj 200 51 hip~ 20; -#X msg 60 48 list \$1; -#X obj 274 59 r \$0-window-gen; -#X obj 274 80 a_hann 2048; -#X obj 148 222 xtract~ peak_spectrum; -#X obj 149 315 xtract~ lowest_value; -#X obj 150 243 a_blockswap~ 2048; -#X obj 359 127 samplerate~; -#X obj 358 150 / 2048; -#X msg 358 171 \$1 10; -#X obj 356 105 r \$0-peak-args; -#X obj 147 195 xtract~ spectrum 2048; -#X connect 0 0 2 0; -#X connect 0 0 8 0; -#X connect 0 0 9 0; -#X connect 0 0 11 0; -#X connect 1 0 19 0; -#X connect 2 0 26 1; -#X connect 3 0 32 0; -#X connect 4 0 22 0; -#X connect 7 0 26 0; -#X connect 8 0 9 1; -#X connect 9 0 12 0; -#X connect 10 0 12 0; -#X connect 11 0 10 1; -#X connect 12 0 14 0; -#X connect 13 0 15 0; -#X connect 14 0 13 0; -#X connect 15 0 18 0; -#X connect 16 0 15 0; -#X connect 18 0 17 0; -#X connect 19 0 21 0; -#X connect 21 0 0 0; -#X connect 21 0 3 0; -#X connect 22 0 0 1; -#X connect 23 0 24 0; -#X connect 24 0 3 1; -#X connect 25 0 27 0; -#X connect 26 0 10 0; -#X connect 27 0 5 0; -#X connect 28 0 29 0; -#X connect 29 0 30 0; -#X connect 30 0 25 1; -#X connect 31 0 28 0; -#X connect 32 0 25 0; -#X restore 357 262 pd pda; -#N canvas 0 0 596 417 d_saw 0; -#X obj 382 176 phasor~; -#X obj 397 96 noise~; -#X obj 346 116 sig~; -#X obj 381 149 +~; -#X obj 397 117 *~; -#X obj 242 198 phasor~; -#X obj 319 283 outlet~; -#X obj 385 215 *~ 0.5; -#X obj 240 227 *~ 0.3; -#X obj 270 173 * 0.01; -#X obj 241 174 +; -#X obj 460 97 * 0.1; -#X obj 312 249 lop~ 10000; -#X obj 369 51 inlet; -#X obj 261 55 inlet fund; -#X obj 258 138 f; -#X obj 286 105 t b f; -#X connect 0 0 7 0; -#X connect 1 0 4 0; -#X connect 2 0 3 0; -#X connect 3 0 0 0; -#X connect 4 0 3 1; -#X connect 5 0 8 0; -#X connect 7 0 12 0; -#X connect 8 0 12 0; -#X connect 9 0 10 1; -#X connect 10 0 5 0; -#X connect 11 0 4 1; -#X connect 12 0 6 0; -#X connect 13 0 16 0; -#X connect 14 0 2 0; -#X connect 14 0 11 0; -#X connect 14 0 15 1; -#X connect 14 0 10 0; -#X connect 15 0 10 0; -#X connect 15 0 9 0; -#X connect 16 0 15 0; -#X connect 16 1 9 1; -#X restore 457 45 pd d_saw; -#X obj 160 262 fiddle~ 2048; -#X obj 75 47 adc~; -#X obj 76 71 a_spigot~; -#X obj 2 69 a_mton; -#X obj 160 283 a_mton; -#X obj 357 301 a_mton; -#X obj 733 -70 loadbang; -#X obj 68 241 loadbang; -#X msg 67 263 symbol; -#X text 411 263 <-The magic happens in here; -#X obj 660 323 a_output~; -#X msg 747 271 0; -#X obj 263 46 r \$0-sine; -#X obj 134 48 r \$0-adc; -#X obj 396 48 r \$0-fm; -#X obj 521 43 r \$0-saw; -#X obj 586 41 r \$0-noisiness; -#X obj 473 -1 r \$0-inharmonicity; -#X obj 161 409 s \$0-fidd_f0_note; -#X obj 178 386 s \$0-fidd_f0_8ve; -#X obj 197 361 s \$0-fidd_f0_cent; -#X obj 356 367 s \$0-pda_f0_note; -#X obj 333 -73 r \$0-fund; -#X obj 375 345 s \$0-pda_f0_8ve; -#X obj 395 326 s \$0-pda_f0_cent; -#X obj 745 230 r \$0-master-lvl-stereo; -#X obj 747 252 r \$0-master-lvl-mute; -#X obj 747 291 s \$0-master-lvl-stereo; -#X obj 733 -45 f \$0; -#X obj 38 357 s \$0-f0_cent; -#X obj 19 378 s \$0-f0_8ve; -#X obj 0 406 s \$0-f0_note; -#X obj 254 261 s~ \$0-dacs; -#X obj 670 281 r~ \$0-dacs; -#X msg 732 -19 \; pd dsp 1 \; \; \$1-window-gen bang \; sr 44100 \; -\; \$1-master-lvl-stereo 50 \; \$1-peak-args bang; -#X connect 0 0 2 0; -#X connect 1 0 9 0; -#X connect 2 0 9 0; -#X connect 3 0 0 0; -#X connect 3 0 12 0; -#X connect 3 0 7 0; -#X connect 3 0 6 0; -#X connect 4 0 3 0; -#X connect 5 0 18 0; -#X connect 6 0 16 0; -#X connect 7 0 1 0; -#X connect 8 0 9 0; -#X connect 9 0 11 0; -#X connect 9 0 13 0; -#X connect 9 0 45 0; -#X connect 10 0 9 1; -#X connect 11 0 5 0; -#X connect 12 0 8 0; -#X connect 13 0 17 0; -#X connect 14 0 15 0; -#X connect 15 0 9 0; -#X connect 16 0 44 0; -#X connect 16 1 43 0; -#X connect 16 2 42 0; -#X connect 17 0 31 0; -#X connect 17 1 32 0; -#X connect 17 2 33 0; -#X connect 18 0 34 0; -#X connect 18 1 36 0; -#X connect 18 2 37 0; -#X connect 19 0 41 0; -#X connect 20 0 21 0; -#X connect 21 0 31 0; -#X connect 21 0 34 0; -#X connect 21 0 44 0; -#X connect 24 0 23 2; -#X connect 24 0 40 0; -#X connect 25 0 2 1; -#X connect 26 0 15 1; -#X connect 27 0 1 1; -#X connect 28 0 8 1; -#X connect 29 0 10 0; -#X connect 30 0 7 1; -#X connect 35 0 4 0; -#X connect 38 0 23 2; -#X connect 39 0 24 0; -#X connect 41 0 47 0; -#X connect 46 0 23 0; -#X connect 46 0 23 1; -#X restore 519 -226 pd guts; -#X obj 11 -226 cnv 15 500 200 empty empty PDA_comparison 20 12 0 14 --261681 -66577 0; -#X obj 34 -94 hsl 128 15 2 2.05 0 0 \$0-inharmonicity empty fm-inharmonicity --2 -6 0 8 -225271 -1 -1 0 1; -#X obj 34 -50 hsl 128 15 0 0.5 0 0 \$0-noisiness empty noisiness -2 --6 0 8 -225271 -1 -1 0 1; -#X obj 33 -135 hsl 128 15 30 3000 0 0 \$0-fund empty f0 -2 -6 0 8 -225271 --1 -1 0 1; -#X obj 32 -172 tgl 15 0 \$0-sine empty sine 0 -6 0 8 -225280 -1 -1 -0 1; -#X obj 73 -172 tgl 15 0 \$0-fm empty fm 0 -6 0 8 -225280 -1 -1 0 1 -; -#X obj 110 -172 tgl 15 0 \$0-saw empty saw 0 -6 0 8 -225280 -1 -1 0 -1; -#X obj 227 -133 cnv 15 200 100 empty empty empty 20 12 0 14 -262131 --66577 0; -#X obj 226 -199 cnv 15 200 60 empty empty empty 20 12 0 14 -225280 --66577 0; -#X symbolatom 242 -170 5 0 0 0 f0 #0-f0_note -; -#X floatatom 312 -170 5 0 0 0 8ve #0-f0_8ve -; -#X symbolatom 245 -112 5 0 0 0 f0 #0-fidd_f0_note -; -#X floatatom 313 -112 5 0 0 0 8ve #0-fidd_f0_8ve -; -#X text 304 -200 Input; -#X text 308 -84 xtract~; -#X text 305 -134 fiddle~; -#X floatatom 315 -62 5 0 0 0 8ve #0-pda_f0_8ve -; -#X symbolatom 247 -62 5 0 0 0 f0 #0-pda_f0_note -; -#X text 20 8 Notes:; -#X text 20 36 In this patch xtract~ is used to provide a combination -of time domain and frequency domain fundamental frequency estimation. -; -#X text 27 233 A block size of 2048 has been used in this example. -Which allows for a theoretical limit of 21Hz. In reality xtract~ can -be used to detect frequencies down to 30Hz with this block size \, -but with a larger block size it could go lower!; -#X text 23 88 [xtract~ f0] uses a method based on the AMDF function -\, with centre and peak clipping used to provide noise robustness. -This could be further improved \, as could the efficiency of the algorithm. -; -#X obj 147 -172 tgl 15 0 \$0-adc empty adc~ 0 -6 0 8 -257472 -1 -1 -0 1; -#X floatatom 386 -171 5 0 0 0 cent #0-f0_cent -; -#X floatatom 386 -63 5 0 0 0 cent #0-pda_f0_cent -; -#X floatatom 386 -113 5 0 0 0 cent #0-fidd_f0_cent -; -#X obj 465 -187 vsl 10 100 0 127 0 0 \$0-master-lvl-stereo \$0-master-lvl-stereo -out -4 -8 0 8 -262131 -1 -1 3898 1; -#X obj 465 -77 bng 10 250 50 0 \$0-master-lvl-mute empty mute -6 16 -0 8 -262131 -1 -1; -#X text 26 154 If [xtract~ f0] is unable to find a fundamental (i.e. -its output is 0 \, the lowest frequency in the peak spectrum is used. -In general this happens for very low frequencies. [xtract~ spectrum] -\, [xtract~ peak_spectrum] \, and [xtract~ lowest_value] are used to -achieve this.; diff --git a/examples/puredata/xtract/mfcc.pd b/examples/puredata/xtract/mfcc.pd deleted file mode 100644 index 2310c7f..0000000 --- a/examples/puredata/xtract/mfcc.pd +++ /dev/null @@ -1,276 +0,0 @@ -#N canvas 737 25 578 583 10; -#N canvas 116 214 598 221 guts 0; -#X obj 318 37 loadbang; -#X obj 318 64 f \$0; -#N canvas 0 0 450 300 dacs 0; -#X obj 164 152 a_output~; -#X msg 251 100 0; -#X obj 249 59 r \$0-master-lvl-stereo; -#X obj 251 81 r \$0-master-lvl-mute; -#X obj 251 120 s \$0-master-lvl-stereo; -#X obj 174 110 inlet~; -#X connect 1 0 0 2; -#X connect 1 0 4 0; -#X connect 2 0 0 2; -#X connect 3 0 1 0; -#X connect 5 0 0 0; -#X connect 5 0 0 1; -#X restore 85 126 pd dacs; -#X obj 16 24 r \$0-fund; -#X msg 318 88 \; pd dsp 1 \; \$1-master-lvl-stereo 60 \; \$1-window-gen -bang \; \$1-mfcc xticks 0 5 5 \; \$1-mfcc yticks 0 50 1 \; \$1-mfcc -xlabel -120 0 5 10 15 20; -#N canvas 308 141 679 510 paf 0; -#X obj 331 95 / 10; -#X obj 331 120 pack 0 50; -#X obj 139 412 fexpr~ $x1 * $x2; -#X obj 241 188 cos~; -#X obj 241 166 expr~ ($v1 * 0.5) - 0.25; -#X obj 380 197 *~ 256; -#X obj 462 209 line~; -#X obj 462 189 pack 0 50; -#X obj 289 194 *~; -#X obj 282 216 +~ 256; -#X obj 118 328 cos~; -#X obj 118 305 *~; -#X obj 161 328 cos~; -#X obj 161 305 +~; -#X obj 154 358 -~; -#X obj 174 390 *~; -#X obj 136 390 +~; -#X obj 230 291 wrap~; -#X obj 199 291 -~; -#X obj 199 259 samphold~; -#X obj 331 142 line~; -#X obj 138 438 outlet~; -#X obj 462 167 inlet bandwidth; -#X obj 47 121 phasor~; -#X obj 48 100 line~; -#X msg 47 78 \$1 20; -#X obj 48 57 inlet fund; -#X obj 331 73 inlet cf; -#X obj 282 316 tabread4~ \$0-hann; -#X obj 466 426 table \$0-hann; -#N canvas 0 0 450 300 hann 0; -#X obj 136 98 samplerate~; -#X obj 139 166 phasor~; -#X msg 225 96 0; -#X obj 139 195 expr~ 0.5 - cos($v1 * 6.28) * 0.5; -#X obj 114 51 t b b b b; -#X obj 114 23 inlet; -#X obj 261 117 s \$0-hann; -#X obj 139 220 tabwrite~ \$0-hann; -#X msg 259 93 resize 512; -#X obj 136 120 /~ 512; -#X connect 0 0 9 0; -#X connect 1 0 3 0; -#X connect 2 0 1 1; -#X connect 3 0 7 0; -#X connect 4 0 7 0; -#X connect 4 1 2 0; -#X connect 4 2 0 0; -#X connect 4 3 8 0; -#X connect 5 0 4 0; -#X connect 8 0 6 0; -#X connect 9 0 1 0; -#X restore 466 390 pd hann; -#X obj 466 362 r \$0-window-gen; -#X connect 0 0 1 0; -#X connect 1 0 20 0; -#X connect 2 0 21 0; -#X connect 3 0 8 0; -#X connect 4 0 3 0; -#X connect 5 0 8 1; -#X connect 6 0 5 0; -#X connect 7 0 6 0; -#X connect 8 0 9 0; -#X connect 9 0 28 0; -#X connect 10 0 14 1; -#X connect 10 0 16 0; -#X connect 11 0 13 0; -#X connect 11 0 10 0; -#X connect 12 0 14 0; -#X connect 13 0 12 0; -#X connect 14 0 15 0; -#X connect 15 0 16 1; -#X connect 16 0 2 0; -#X connect 17 0 18 1; -#X connect 17 0 15 1; -#X connect 18 0 11 1; -#X connect 19 0 18 0; -#X connect 19 0 17 0; -#X connect 20 0 19 0; -#X connect 22 0 7 0; -#X connect 23 0 19 1; -#X connect 23 0 13 1; -#X connect 23 0 11 0; -#X connect 23 0 4 0; -#X connect 24 0 23 0; -#X connect 25 0 24 0; -#X connect 26 0 25 0; -#X connect 27 0 0 0; -#X connect 28 0 2 1; -#X connect 31 0 30 0; -#X restore 35 80 pd paf; -#X obj 85 25 r \$0-cf; -#X obj 140 23 r \$0-bw; -#X obj 145 127 r \$0-window-gen; -#X obj 145 148 a_hann 1024; -#N canvas 34 54 723 391 spectrum 0; -#X obj 194 153 *~; -#X obj 181 69 inlet~; -#X obj 252 68 inlet~; -#X obj 195 176 xtract~ spectrum; -#N canvas 0 0 450 300 mag_spectrum 0; -#X obj 260 64 block~ 512; -#N canvas 0 0 450 300 (subpatch) 0; -#X array mag_spectrum 512 float 3; -#A 0 0.0347679 0.0238386 0.0342933 0.0362505 0.0295941 0.0500627 0.0356107 -0.0419818 0.0507073 0.0290984 0.0416723 0.0321575 0.0192698 0.0252058 -0.0116167 0.00836482 0.00784646 0.00138145 0.00132721 0.000381971 0.000573959 -0.000406984 0.000280216 0.000179901 0.000186049 0.000268997 0.000263714 -0.000155282 0.000139129 0.000167519 0.000124361 0.000180699 0.000142076 -0.000144225 0.000119736 0.000148186 0.000111046 0.000121504 0.000107089 -0.000121003 9.47739e-05 0.000125579 0.000100434 0.000104701 9.41711e-05 -0.000104671 8.29275e-05 9.69602e-05 8.842e-05 9.28634e-05 8.08756e-05 -9.55736e-05 7.85888e-05 8.25423e-05 7.83809e-05 8.18489e-05 7.07095e-05 -8.02309e-05 7.42804e-05 7.48963e-05 6.96933e-05 7.65881e-05 6.52446e-05 -6.90523e-05 6.72559e-05 6.77385e-05 6.22041e-05 6.80202e-05 6.33565e-05 -6.27514e-05 6.09007e-05 6.3778e-05 5.64576e-05 5.99506e-05 5.87628e-05 -5.80413e-05 5.54242e-05 5.86565e-05 5.49603e-05 5.42429e-05 5.4014e-05 -5.47262e-05 5.03136e-05 5.31452e-05 5.20179e-05 5.08749e-05 4.98008e-05 -5.13611e-05 4.85163e-05 4.80735e-05 4.85478e-05 4.80833e-05 4.56452e-05 -4.77271e-05 4.64662e-05 4.53934e-05 4.50956e-05 4.56013e-05 4.35624e-05 -4.34772e-05 4.40007e-05 4.30346e-05 4.18994e-05 4.31475e-05 4.18919e-05 -4.11025e-05 4.11284e-05 4.10175e-05 3.97421e-05 3.98145e-05 4.01797e-05 -3.90583e-05 3.87068e-05 3.92256e-05 3.81535e-05 3.76564e-05 3.77768e-05 -3.73499e-05 3.66974e-05 3.67557e-05 3.68833e-05 3.58508e-05 3.59041e-05 -3.58715e-05 3.51094e-05 3.48463e-05 3.49077e-05 3.43984e-05 3.41789e-05 -3.40861e-05 3.40455e-05 3.32054e-05 3.34367e-05 3.30168e-05 3.26526e-05 -3.24827e-05 3.24396e-05 3.19881e-05 3.19942e-05 3.17211e-05 3.16122e-05 -3.10021e-05 3.12408e-05 3.06344e-05 3.06429e-05 3.04321e-05 3.03029e-05 -2.99668e-05 3.00742e-05 2.95874e-05 2.95749e-05 2.91166e-05 2.92872e-05 -2.87315e-05 2.88123e-05 2.86934e-05 2.84017e-05 2.82494e-05 2.83481e-05 -2.76694e-05 2.7905e-05 2.74856e-05 2.7595e-05 2.70659e-05 2.73785e-05 -2.70175e-05 2.68042e-05 2.67559e-05 2.67275e-05 2.61115e-05 2.64444e-05 -2.60253e-05 2.6143e-05 2.56633e-05 2.59967e-05 2.55765e-05 2.54011e-05 -2.54205e-05 2.52767e-05 2.48309e-05 2.51035e-05 2.48111e-05 2.47337e-05 -2.44776e-05 2.47857e-05 2.41466e-05 2.42557e-05 2.41419e-05 2.40363e-05 -2.36974e-05 2.39439e-05 2.36521e-05 2.35678e-05 2.34062e-05 2.3597e-05 -2.29854e-05 2.32039e-05 2.30333e-05 2.29341e-05 2.27001e-05 2.29057e-05 -2.25917e-05 2.25413e-05 2.24169e-05 2.25144e-05 2.1993e-05 2.22539e-05 -2.20491e-05 2.19648e-05 2.18146e-05 2.19472e-05 2.16342e-05 2.16211e-05 -2.15227e-05 2.15229e-05 2.11552e-05 2.13981e-05 2.1145e-05 2.11307e-05 -2.10028e-05 2.10558e-05 2.07771e-05 2.08104e-05 2.06922e-05 2.06572e-05 -2.0421e-05 2.06044e-05 2.03378e-05 2.03852e-05 2.0236e-05 2.02428e-05 -2.00298e-05 2.00682e-05 1.99341e-05 1.99055e-05 1.9766e-05 1.98595e-05 -1.96149e-05 1.9708e-05 1.95175e-05 1.951e-05 1.93652e-05 1.93882e-05 -1.9253e-05 1.92475e-05 1.91492e-05 1.91725e-05 1.89653e-05 1.90797e-05 -1.88526e-05 1.88553e-05 1.87737e-05 1.87674e-05 1.86322e-05 1.86603e-05 -1.85738e-05 1.8523e-05 1.84042e-05 1.84821e-05 1.82465e-05 1.82856e-05 -1.82333e-05 1.81908e-05 1.80772e-05 1.81247e-05 1.80205e-05 1.79422e-05 -1.78919e-05 1.79356e-05 1.76952e-05 1.77907e-05 1.77256e-05 1.76545e-05 -1.75951e-05 1.76011e-05 1.75059e-05 1.74307e-05 1.74315e-05 1.73783e-05 -1.72885e-05 1.72999e-05 1.72644e-05 1.71807e-05 1.71397e-05 1.71261e-05 -1.70455e-05 1.6948e-05 1.70073e-05 1.6948e-05 1.6794e-05 1.69151e-05 -1.68262e-05 1.6732e-05 1.67057e-05 1.67527e-05 1.65599e-05 1.65856e-05 -1.65865e-05 1.65142e-05 1.64285e-05 1.65163e-05 1.63755e-05 1.63693e-05 -1.63267e-05 1.62936e-05 1.62273e-05 1.6209e-05 1.62148e-05 1.61265e-05 -1.61024e-05 1.61131e-05 1.60167e-05 1.60016e-05 1.59628e-05 1.59332e-05 -1.58903e-05 1.58553e-05 1.58772e-05 1.57569e-05 1.57924e-05 1.57572e-05 -1.56537e-05 1.56966e-05 1.56074e-05 1.56212e-05 1.55779e-05 1.5539e-05 -1.55494e-05 1.5449e-05 1.5495e-05 1.54081e-05 1.53711e-05 1.53932e-05 -1.52964e-05 1.53376e-05 1.52897e-05 1.52396e-05 1.52538e-05 1.51629e-05 -1.52182e-05 1.50957e-05 1.51177e-05 1.51097e-05 1.50368e-05 1.50477e-05 -1.50399e-05 1.49629e-05 1.49619e-05 1.4934e-05 1.49109e-05 1.48107e-05 -1.49298e-05 1.48269e-05 1.47474e-05 1.48734e-05 1.47248e-05 1.47904e-05 -1.46943e-05 1.47132e-05 1.46267e-05 1.47303e-05 1.44649e-05 1.46803e-05 -1.45807e-05 1.45165e-05 1.45321e-05 1.45863e-05 1.44389e-05 1.44883e-05 -1.45138e-05 1.43366e-05 1.45488e-05 1.42999e-05 1.43532e-05 1.43481e-05 -1.44012e-05 1.40856e-05 1.4473e-05 1.42298e-05 1.42492e-05 1.42315e-05 -1.43224e-05 1.40978e-05 1.42317e-05 1.41411e-05 1.41222e-05 1.41452e-05 -1.40687e-05 1.4097e-05 1.40772e-05 1.40533e-05 1.4062e-05 1.39999e-05 -1.40167e-05 1.39786e-05 1.39683e-05 1.39479e-05 1.39503e-05 1.39196e-05 -1.39185e-05 1.3891e-05 1.38968e-05 1.38385e-05 1.38591e-05 1.38226e-05 -1.3823e-05 1.37987e-05 1.38058e-05 1.37687e-05 1.37731e-05 1.37467e-05 -1.3741e-05 1.37012e-05 1.37238e-05 1.36772e-05 1.36989e-05 1.36648e-05 -1.36677e-05 1.36383e-05 1.36465e-05 1.36082e-05 1.36107e-05 1.35828e-05 -1.36001e-05 1.35517e-05 1.35862e-05 1.35436e-05 1.3545e-05 1.35258e-05 -1.35259e-05 1.34894e-05 1.35036e-05 1.34777e-05 1.34856e-05 1.34502e-05 -1.34863e-05 1.34282e-05 1.34469e-05 1.34125e-05 1.34237e-05 1.34026e-05 -1.33887e-05 1.34055e-05 1.33624e-05 1.33684e-05 1.34108e-05 1.32959e-05 -1.33875e-05 1.32811e-05 1.33619e-05 1.33219e-05 1.3276e-05 1.33497e-05 -1.32483e-05 1.33257e-05 1.3305e-05 1.32275e-05 1.33069e-05 1.32249e-05 -1.32866e-05 1.32339e-05 1.32487e-05 1.3251e-05 1.32172e-05 1.32353e-05 -1.323e-05 1.31875e-05 1.32223e-05 1.319e-05 1.32038e-05 1.31846e-05 -1.31983e-05 1.31761e-05 1.31802e-05 1.31635e-05 1.31737e-05 1.31439e-05 -1.31682e-05 1.31427e-05 1.31617e-05 1.31332e-05 1.31547e-05 1.3133e-05 -1.31335e-05 1.31252e-05 1.31203e-05 1.31178e-05 1.313e-05 1.31048e-05 -1.31309e-05 1.30961e-05 1.31287e-05 1.30943e-05 1.31076e-05 1.3093e-05 -1.30996e-05 1.30943e-05 1.3103e-05 1.30871e-05 1.31077e-05 1.30727e-05 -1.31072e-05 1.30737e-05 1.3094e-05 1.30748e-05 1.30877e-05 1.30874e-05 -1.30868e-05 1.30789e-05 1.30949e-05 1.30709e-05 1.30856e-05; -#X coords 0 1 511 0 200 140 1; -#X restore 125 121 graph; -#X restore 358 92 pd mag_spectrum; -#X obj 195 211 tabsend~ mag_spectrum; -#X obj 357 64 block~ 1024; -#X obj 197 301 xtract~ mfcc; -#X obj 196 274 tabreceive~ mag_spectrum; -#X obj 197 333 tabsend~ \$0-mfcc; -#X connect 0 0 3 0; -#X connect 1 0 0 0; -#X connect 2 0 0 1; -#X connect 3 0 5 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X restore 32 167 pd spectrum; -#X connect 0 0 1 0; -#X connect 1 0 4 0; -#X connect 3 0 5 0; -#X connect 5 0 2 0; -#X connect 5 0 10 0; -#X connect 6 0 5 1; -#X connect 7 0 5 2; -#X connect 8 0 9 0; -#X connect 9 0 10 1; -#X restore 516 -222 pd guts; -#X obj 6 -225 cnv 15 500 200 empty empty MFCC 20 12 0 14 -261681 -66577 -0; -#X obj 184 -202 cnv 15 250 150 empty empty empty 20 12 0 14 -262131 --66577 0; -#X obj 465 -187 vsl 10 100 0 127 0 0 \$0-master-lvl-stereo \$0-master-lvl-stereo -out -4 -8 0 8 -262131 -1 -1 0 1; -#X obj 465 -77 bng 10 250 50 0 \$0-master-lvl-mute empty mute -6 16 -0 8 -262131 -1 -1; -#X obj 32 -114 hsl 128 15 20 150 0 0 \$0-cf empty centre_frequency --2 -6 0 8 -225271 -1 -1 700 1; -#X obj 33 -153 hsl 128 15 80 2000 0 0 \$0-fund empty fundamental -2 --6 0 8 -225271 -1 -1 200 1; -#X text 19 7 Notes:; -#X text 20 87 [xtract~ mfcc] outputs a series 20 Mel-Frequency Cepstral -Coefficients. When it is instantiated \, an initialisation function -creates a bank of 20 mel-spaced filters \, between 80Hz and 1800Hz -on a linear scale. All filters have the same gain; -#X text 23 255 With LibXtract it is possible to change the number of -Mel filters as well as the range of frequencies over which they operate -\, and the filter scaling (equal area/equal gain). With this PD example -\, sensible defaults have been chosen to improve usability; -#N canvas 0 0 450 300 (subpatch) 0; -#X array \$0-mfcc 20 float 1; -#A 0 -226.816 39.0179 27.0649 13.3895 3.18296 -4.35309 -6.98078 -6.73432 --4.09373 -1.24401 0.693745 0.961352 0.393719 -0.854615 -1.49734 -1.75847 --1.32051 -0.652124 0.00802549 0.234184; -#X coords 0 50 19 -500 200 100 1; -#X restore 212 -178 graph; -#X text 28 -188 PAF synthesiser; -#X obj 34 -71 hsl 128 15 1 10 0 0 \$0-bw empty formant_bandwidth -2 --6 0 8 -225271 -1 -1 600 1; -#X text 20 36 In this patch [xtract~ spectrum] is first used to extract -the magnitude spectrum from an audio signal in overlapping blocks of -1024 samples.; -#X text 23 165 Whilst DSP is running the input vector (magnitude spectrum) -is filtered by this filterbank \, and the total energy output from -each filter is appended to a new vector. This new vector (mel-filtered -spectrum) is then subjected to a fast cosine transform. The output -can be visualised in the graph labelled \$0-mfcc.; diff --git a/examples/puredata/xtract/sonogram.pd b/examples/puredata/xtract/sonogram.pd deleted file mode 100644 index 78a7b42..0000000 --- a/examples/puredata/xtract/sonogram.pd +++ /dev/null @@ -1 +0,0 @@ -#N canvas 0 0 450 300 10; diff --git a/examples/puredata/xtract/xtract-help.pd b/examples/puredata/xtract/xtract-help.pd deleted file mode 100644 index 8e0959b..0000000 --- a/examples/puredata/xtract/xtract-help.pd +++ /dev/null @@ -1,42 +0,0 @@ -#N canvas 685 60 450 725 10; -#X text 21 12 [xtract~]; -#X text 24 19 ________; -#X text 22 52 [xtract~] provides a wrapper for the feature extraction -library: LibXtract. Please refer to the documentation at libxtract.sourceforge.net -\, for a full explanation of the library and the functions it provides. -Only the operation of the PD external will be explained here along -with a few use case scenarios.; -#X obj 27 299 xtract~; -#X msg 27 270 help; -#X text 27 328 Other than this help message \, the data sent to the -left inlet should always be a 'signal' (i.e. audio rate). This is the -data from a which a given feature will be extracted.; -#X obj 183 520 xtract~ mean; -#X floatatom 133 616 10 0 0 0 - - -; -#X floatatom 254 553 5 0 0 0 - - -; -#X msg 183 552 list \$1; -#X obj 133 586 xtract~ variance; -#X obj 182 496 phasor~ 0.1; -#X text 40 671 Below are some possible use cases (click to open):; -#X text 27 382 The outlet may be a scalar (control rate) \, or a vector -(audio rate) \, depending on the nature of the feature that is being -extracted.; -#X obj 43 695 f0; -#X obj 84 695 mfcc; -#X text 28 435 Any additional arguments that need to be passed to the -feature extraction function must be provided as a list to the right -inlet \, e.g.; -#X text 24 231 A complete list of features may be obtained by sending -the external a |help( message:; -#X text 20 148 [xtract~] must always be called with one argument \, -in the following form: [xtract~ <feature>] \, where <feature> is a -feature supported by the LibXtract library.; -#X text 21 198 An optional second argument can be used to explicitly -set the blocksize for FFT-based features; -#X connect 4 0 3 0; -#X connect 6 0 8 0; -#X connect 6 0 9 0; -#X connect 9 0 10 1; -#X connect 10 0 7 0; -#X connect 11 0 6 0; -#X connect 11 0 10 0; diff --git a/examples/puredata/xtract~.c b/examples/puredata/xtract~.c deleted file mode 100644 index a7f7325..0000000 --- a/examples/puredata/xtract~.c +++ /dev/null @@ -1,416 +0,0 @@ -/* - * Copyright (C) 2012 Jamie Bullock - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - * - */ - -/* calculates the spectral xtract of one frame, given peak frequency and amplitude to first and second inputs respectively */ - -#include "m_pd.h" -#include <math.h> -#include <string.h> - -#include "xtract/libxtract.h" - -#define BLOCKSIZE 1024 /* FIX: this should be dynamic - somehow */ -#define NYQUIST 22050.0f - -#ifndef isnan - /* FIX: should probably try to handle signalling NaNs */ - int isnan(x){ if(x == x) return 0; else return 1;} -#endif - -#ifndef isinf - int isinf(x) {if(x == 1.0 / 0. || x == -1.0 / 0.) return 1; else return 0;} -#endif - -static t_class *xtract_class; - -/* Struct for keeping track of memory allocations */ -typedef struct _tracked_memory { - char argv; -} tracked_memory; - -typedef struct _xtract { - t_object x_obj; - t_float f; - double *window; - double *data; - double *result; - t_int feature, - is_scalar, - is_subframe, - argv_type, - init_blocksize, - done_init; - t_symbol *feature_name; - tracked_memory memory; - void *argv; -} t_xtract_tilde; - -static t_int *xtract_perform(t_int *w) { - t_sample *in = (t_sample *)(w[1]); - t_xtract_tilde *x = (t_xtract_tilde *)(w[2]); - t_int N = (t_int)(w[3]); - t_int rv = 0; - double result = 0.0; - - for(t_int n = 0; n < N; ++n) { - x->data[n] = (double)in[n]; - } - - rv = xtract[x->feature](x->data, N, x->argv, &result); - - if(rv == XTRACT_FEATURE_NOT_IMPLEMENTED) - pd_error(x, "Feature not implemented"); - - /* set nan, inf or -inf to 0 */ - result = (isinf(result) || isnan(result) ? 0.0 : result); - - outlet_float(x->x_obj.ob_outlet, (float)result); - return (w+4); -} - -static t_int *xtract_perform_vector(t_int *w) { - - t_sample *in = (t_sample *)(w[1]); - t_sample *out = (t_sample *)(w[2]); - t_xtract_tilde *x = (t_xtract_tilde *)(w[3]); - t_int N = (t_int)(w[4]), n; - t_int rv = 0; - - if(N != x->init_blocksize && x->done_init){ - error("xtract~ %s: Blocksize mismatch, try specifying the blocksize as a second argument", x->feature_name->s_name); - return (w+5); - } - - n = N; - - for(n = 0; n < N; ++n) { - x->data[n] = (double)in[n]; - } - - if(x->feature == XTRACT_PEAK_SPECTRUM || x->feature == XTRACT_LPC) - N >>= 1; - - if(x->is_subframe){ - - rv = xtract_features_from_subframes(x->data, N, x->feature, - x->argv, x->result); - } - else{ - - rv = xtract[x->feature](x->data, N, x->argv, x->result); - } - - if(rv == XTRACT_FEATURE_NOT_IMPLEMENTED) - pd_error(x, "Feature not implemented"); - - while(n--) - out[n] = (float)x->result[n]; - - return (w+5); -} - -static void xtract_dsp(t_xtract_tilde *x, t_signal **sp) { - - if(!x->is_scalar){ - dsp_add(xtract_perform_vector, 4, - sp[0]->s_vec, sp[1]->s_vec, x, sp[0]->s_n); - } - - else - dsp_add(xtract_perform, 3, sp[0]->s_vec, x, sp[0]->s_n); - -} - -static void *xtract_new(t_symbol *me, t_int argc, t_atom *argv) { - - t_xtract_tilde *x = (t_xtract_tilde *)pd_new(xtract_class); - xtract_mel_filter *mf; - t_int n, N, M, f, F, - n_args, - type; - double *argv_max; - t_symbol *arg1; - xtract_function_descriptor_t *fd; - char *p_name, - *p_desc, - *author; - int year; - - p_name = p_desc = author = NULL; - - n_args = type = 0; - - f = F = XTRACT_FEATURES; - - N = BLOCKSIZE; - - x->argv = NULL; - x->argv_type = 0; - x->done_init = 0; - x->is_scalar = 0; - x->is_subframe = 0; - x->feature = -1; - - /* Allocate data area */ - x->data = (double *)getbytes(N * sizeof(double)); - x->result = (double *)getbytes(N * sizeof(double)); - - /* Parse arguments */ - if(argc){ - arg1 = atom_getsymbol(argv); - if(arg1 == gensym("subframe")) - x->is_subframe = 1; - else - x->feature_name = atom_getsymbol(argv); - } - else { - post("xtract~: No arguments given"); - return (void *)x; - } - if(argc > 1){ - if(x->is_subframe) - x->feature_name = atom_getsymbol(argv+1); - else - N = atom_getint(argv+1); - } - if(argc > 2) - N = atom_getint(argv+2); - - x->init_blocksize = N; - M = N >> 1; - - /* get function descriptors */ - fd = (xtract_function_descriptor_t *)xtract_make_descriptors(); - - /* iterate over descriptors */ - while(f--){ - /* map creation arg to feature */ - if(x->feature_name == gensym(fd[f].algo.name)){ - x->feature = f; - break; - } - } - - if(x->feature == -1) - post("xtract~: feature not found: %s", x->feature_name->s_name); - - /* allocate memory for feature arguments */ - n_args = fd[f].argc; - type = fd[f].argv.type; - - x->argv_type = type; - - if(n_args){ - for(n = 0; n < n_args; n++){ - argv_max = &fd[f].argv.max[n]; - /*post("Argument %d, max: %.2f", n, *argv_max); */ - } - if(type == XTRACT_MEL_FILTER){ - x->memory.argv = (size_t)(n_args * sizeof(xtract_mel_filter)); - x->argv = (xtract_mel_filter *)getbytes(x->memory.argv); - } - else if(type == XTRACT_INT){ - x->memory.argv = (size_t)(n_args * sizeof(t_int)); - x->argv = (t_int *)getbytes(x->memory.argv); - } - else if (type == XTRACT_FLOAT){ - x->memory.argv = (size_t)(n_args * sizeof(t_float)); - x->argv = (t_float *)getbytes(x->memory.argv); - } - else - x->memory.argv = 0; - } - - p_name = fd[f].algo.p_name; - p_desc = fd[f].algo.p_desc; - author = fd[f].algo.author; - year = fd[f].algo.year; - - if(argc){ - if(strcmp(p_name, "")) - post("xtract~: %s", p_name ); - if(strcmp(p_desc, "")) - post("xtract~: %s", p_desc ); - if(strcmp(author, "") && year) - post("xtract~: %s(%d)", author, year); - } - - /* Adjust frame size if we are using subframe features */ - if(x->is_subframe) - N = M; - - post("xtract~: assumed window size: %d", N); - - /* do init if needed */ - if(x->feature == XTRACT_MFCC){ - - mf = x->argv; - - mf->n_filters = 20; - - post("xtract~: mfcc: filters = %d", - ((xtract_mel_filter *)x->argv)->n_filters); - mf->filters = - (double **)getbytes(mf->n_filters * sizeof(double *)); - for(n = 0; n < mf->n_filters; n++) - mf->filters[n] = (double *)getbytes(N * sizeof(double)); - - xtract_init_mfcc(N, NYQUIST, XTRACT_EQUAL_GAIN, 80.0f, - 18000.0f, mf->n_filters, mf->filters); - x->done_init = 1; - } - else if(x->feature == XTRACT_BARK_COEFFICIENTS){ - xtract_init_bark(N, NYQUIST, x->argv); - x->done_init = 1; - } - else if(x->feature == XTRACT_WINDOWED){ - x->window = xtract_init_window(N, XTRACT_HANN); - x->argv = x->window; - x->done_init = 1; - } - else if(x->feature == XTRACT_WAVELET_F0){ - xtract_init_wavelet_f0_state(); - } - - /* Initialise fft_plan if required */ - if(x->feature == XTRACT_AUTOCORRELATION_FFT || - x->feature == XTRACT_SPECTRUM || - x->feature == XTRACT_DCT){ - xtract_init_fft(N, x->feature); - x->done_init = 1; - } - - if(fd[f].is_scalar) - x->is_scalar = 1; - -/* - if(x->feature == XTRACT_AUTOCORRELATION || - x->feature == XTRACT_AUTOCORRELATION_FFT || - x->feature == XTRACT_MFCC || x->feature == XTRACT_AMDF || - x->feature == XTRACT_ASDF|| x->feature == XTRACT_DCT || - x->feature == XTRACT_BARK_COEFFICIENTS || - x->feature == XTRACT_SPECTRUM || - x->feature == XTRACT_PEAK_SPECTRUM || - x->feature == XTRACT_HARMONIC_SPECTRUM || - x->feature == XTRACT_LPC || - x->feature == XTRACT_LPCC || - x->feature == XTRACT_WINDOWED) - x->feature_type = XTRACT_VECTOR; - */ - /* else if (x->feature == XTRACT_FLUX || x->feature == XTRACT_ATTACK_TIME || - x->feature == XTRACT_DECAY_TIME || x->feature == XTRACT_DIFFERENCE_VECTOR) - x->feature_type = XTRACT_DELTA; */ -/* - else x->feature_type = XTRACT_SCALAR; -*/ - - /* argv through right inlet */ - inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("list"), gensym("list")); - - /* if feature is vector, create signal out */ - if(!x->is_scalar) - outlet_new(&x->x_obj, &s_signal); - - /* otherwise: float */ - else - outlet_new(&x->x_obj, &s_float); - - if(x->is_scalar && x->is_subframe) - post( - "xtract~: warning: subframes not yet supported for scalar features"); - - /* free the function descriptors */ - xtract_free_descriptors(fd); - - return (void *)x; -} - -static void xtract_tilde_get_args(t_xtract_tilde *x, t_symbol *selector, -t_int argc, t_atom *argv) { -/* - if(argc > (t_int)sizeof(x->argv) / - (t_int)sizeof(t_float) || x->argv == NULL) - post("Too many parameters to right inlet"); - else{*/ - - x->argv = getbytes(argc * sizeof(float)); - - while(argc--){ - switch(x->argv_type){ - case XTRACT_INT: - ((t_int *)x->argv)[argc] = (int)atom_getfloat(&argv[argc]); - break; - case XTRACT_FLOAT: - default: - ((t_float *)x->argv)[argc] = atom_getfloat(&argv[argc]); - break; - } - } - /* }*/ -} - -static void xtract_tilde_show_help(t_xtract_tilde *x, t_symbol *s){ - - int i; - - xtract_function_descriptor_t *fd, *d; - - i = XTRACT_FEATURES; - - fd = (xtract_function_descriptor_t *)xtract_make_descriptors(); - post("\nxtract~: Feature List\n"); - - while(i--){ - d = &fd[i]; - post("\t%s", d->algo.name); - } - - xtract_free_descriptors(fd); -} - -static void xtract_tilde_free(t_xtract_tilde *x) { - - if(x->argv != NULL && x->memory.argv) - freebytes(x->argv, x->memory.argv); - - if(x->window != NULL) - xtract_free_window(x->window); -} - -void xtract_tilde_setup(void) { - xtract_class = class_new(gensym("xtract~"), - (t_newmethod)xtract_new, - (t_method)xtract_tilde_free, - sizeof(t_xtract_tilde), - CLASS_DEFAULT, - A_GIMME, 0); - - class_addmethod(xtract_class, - (t_method)xtract_dsp, gensym("dsp"), 0); - class_addmethod(xtract_class, - (t_method)xtract_tilde_get_args, gensym("list"), A_GIMME, 0); - class_addmethod(xtract_class, - (t_method)xtract_tilde_show_help, gensym("help"), A_DEFSYMBOL, 0); - CLASS_MAINSIGNALIN(xtract_class, t_xtract_tilde, f); - class_sethelpsymbol(xtract_class, gensym("xtract-help")); -} diff --git a/examples/simpletest/Make.config b/examples/simpletest/Make.config new file mode 100644 index 0000000..9f3640a --- /dev/null +++ b/examples/simpletest/Make.config @@ -0,0 +1,9 @@ + +ifeq ($(PLATFORM), Darwin) + DARWIN_LDFLAGS = -framework Accelerate +endif + +LIBRARY := +SUFFIX := .cpp +FLAGS += -I../../include +LDFLAGS = -lxtract -L../../src $(DARWIN_LDFLAGS) diff --git a/examples/simpletest/Makefile b/examples/simpletest/Makefile new file mode 100644 index 0000000..f120975 --- /dev/null +++ b/examples/simpletest/Makefile @@ -0,0 +1,105 @@ +#### +#### Generic Makefile for C or C++ projects +#### +#### This file is public domain. +#### Jamie Bullock 2014 <jamie@jamiebullock.com> +#### + +################################### +### User configurable variables ### +################################### + +#### It is best not to modify this file +#### Instead override these variables in a separate Make.config file if needed + +# The name of the product to build (default uses parent directory name) +NAME ?= $(notdir $(CURDIR)) +# The file suffix of source files, can be .c or .cpp +SUFFIX ?= .c +# List of directories containing source files to be compiled +DIRS ?= . +# Flags to pass to the compiler for release builds +FLAGS ?= -O3 +# Flags to pass to the compiler for debug builds +DEBUG_FLAGS ?= -O0 -g +# Flags to pass to the linker +LDFLAGS ?= +# Type of product to build: "shared" for a shared library, "static" for a static library, empty for standalone +LIBRARY ?= static +# Prefix to the path that the "install" target will install into. libs to $(PREFIX)/lib, executables to $(PREFIX)/bin +PREFIX ?= /usr/local + +############################################## +### Do not modify anything below this line ### +############################################## + +ifeq ($(OS),Windows_NT) +else + PLATFORM := $(shell uname -s) +endif + +-include Make.config + +OUT_DIR := .build +SRC := $(foreach dir, $(DIRS), $(wildcard $(dir)/*$(SUFFIX))) +OBJ_ := $(SRC:$(SUFFIX)=.o) +OBJ := $(addprefix $(OUT_DIR)/,$(OBJ_)) +DEPS := $(OBJ:.o=.d) +SHARED_SUFFIX := dll +STATIC_SUFFIX := lib +INSTALL_DIR := $(PREFIX)/lib + +ifeq "$(PLATFORM)" "Darwin" + SHARED_SUFFIX := dylib + STATIC_SUFFIX := a +endif + +ifeq "$(PLATFORM)" "Linux" + SHARED_SUFFIX := so + STATIC_SUFFIX := a +endif + +ifeq "$(LIBRARY)" "shared" + OUT=lib$(NAME).$(SHARED_SUFFIX) + LDFLAGS += -shared +else ifeq "$(LIBRARY)" "static" + OUT=lib$(NAME).$(STATIC_SUFFIX) +else + OUT=$(NAME) + INSTALL_DIR := $(PREFIX)/bin +endif + +ifeq "$(SUFFIX)" ".cpp" + COMPILER := $(CXX) +else ifeq "$(SUFFIX)" ".c" + COMPILER := $(CC) +endif + +.SUFFIXES: +.PHONY: debug clean install uninstall + +$(OUT): $(OBJ) +ifeq "$(LIBRARY)" "static" + @$(AR) rcs $@ $^ +else + @$(COMPILER) $(LDFLAGS) $^ -o $@ +endif + +debug: FLAGS = $(DEBUG_FLAGS) +debug: $(OUT) + +$(OUT_DIR)/%.o: %$(SUFFIX) + @mkdir -p $(dir $@) + @$(COMPILER) $(CXXFLAGS) $(FLAGS) -MMD -MP -fPIC -c $< -o $@ + +install: $(OUT) + @install -d $(INSTALL_DIR) + @install $(OUT) $(INSTALL_DIR) + +uninstall: + @$(RM) $(INSTALL_DIR)/$(OUT) + +clean: + @$(RM) -r $(OUT) $(OUT_DIR) + +-include: $(DEPS) diff --git a/examples/simpletest/Makefile.am b/examples/simpletest/Makefile.am deleted file mode 100644 index 9f4256a..0000000 --- a/examples/simpletest/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -MAINTAINERCLEANFILES = Makefile.in - -noinst_PROGRAMS = simpletest -AM_CPPFLAGS = -I$(top_srcdir)/src -simpletest_SOURCES = simpletest.cpp WaveFile.cpp -simpletest_LDADD = ../../src/libxtract.la - - diff --git a/xtract/libxtract.h b/include/xtract/libxtract.h index 17540c5..17540c5 100644 --- a/xtract/libxtract.h +++ b/include/xtract/libxtract.h diff --git a/xtract/xtract_delta.h b/include/xtract/xtract_delta.h index c7b3ee7..c7b3ee7 100644 --- a/xtract/xtract_delta.h +++ b/include/xtract/xtract_delta.h diff --git a/xtract/xtract_helper.h b/include/xtract/xtract_helper.h index 7296f0e..7296f0e 100644 --- a/xtract/xtract_helper.h +++ b/include/xtract/xtract_helper.h diff --git a/xtract/xtract_macros.h b/include/xtract/xtract_macros.h index 3445866..3445866 100644 --- a/xtract/xtract_macros.h +++ b/include/xtract/xtract_macros.h diff --git a/xtract/xtract_scalar.h b/include/xtract/xtract_scalar.h index 8e24284..8e24284 100644 --- a/xtract/xtract_scalar.h +++ b/include/xtract/xtract_scalar.h diff --git a/xtract/xtract_stateful.h b/include/xtract/xtract_stateful.h index 6a5c900..6a5c900 100644 --- a/xtract/xtract_stateful.h +++ b/include/xtract/xtract_stateful.h diff --git a/xtract/xtract_types.h b/include/xtract/xtract_types.h index fe75b6e..fe75b6e 100644 --- a/xtract/xtract_types.h +++ b/include/xtract/xtract_types.h diff --git a/xtract/xtract_vector.h b/include/xtract/xtract_vector.h index f935da6..f935da6 100644 --- a/xtract/xtract_vector.h +++ b/include/xtract/xtract_vector.h diff --git a/libxtract.pc.in b/libxtract.pc.in deleted file mode 100644 index 6a1dcfd..0000000 --- a/libxtract.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: libxtract -Description: A lightweight feature extraction library -Version: @VERSION@ -Libs: -L${libdir} -lxtract -Cflags: -I${includedir} diff --git a/m4/ac_jni_include_dir.m4 b/m4/ac_jni_include_dir.m4 deleted file mode 100644 index b8cbf34..0000000 --- a/m4/ac_jni_include_dir.m4 +++ /dev/null @@ -1,112 +0,0 @@ -##### http://autoconf-archive.cryp.to/ac_jni_include_dir.html -# -# SYNOPSIS -# -# AC_JNI_INCLUDE_DIR -# -# DESCRIPTION -# -# AC_JNI_INCLUDE_DIR finds include directories needed for compiling -# programs using the JNI interface. -# -# JNI include directories are usually in the java distribution This -# is deduced from the value of JAVAC. When this macro completes, a -# list of directories is left in the variable JNI_INCLUDE_DIRS. -# -# Example usage follows: -# -# AC_JNI_INCLUDE_DIR -# -# for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS -# do -# CPPFLAGS="$CPPFLAGS -I$JNI_INCLUDE_DIR" -# done -# -# If you want to force a specific compiler: -# -# - at the configure.in level, set JAVAC=yourcompiler before calling -# AC_JNI_INCLUDE_DIR -# -# - at the configure level, setenv JAVAC -# -# Note: This macro can work with the autoconf M4 macros for Java -# programs. This particular macro is not part of the original set of -# macros. -# -# LAST MODIFICATION -# -# 2006-05-27 -# -# COPYLEFT -# -# Copyright (c) 2006 Don Anderson <dda@sleepycat.com> -# -# Copying and distribution of this file, with or without -# modification, are permitted in any medium without royalty provided -# the copyright notice and this notice are preserved. - -AC_DEFUN([AC_JNI_INCLUDE_DIR],[ - -JNI_INCLUDE_DIRS="" - -test "x$JAVAC" = x && AC_MSG_ERROR(['\$JAVAC' undefined]) -AC_PATH_PROG(_ACJNI_JAVAC, $JAVAC, no) -test "x$_ACJNI_JAVAC" = xno && AC_MSG_ERROR([$JAVAC could not be found in path]) - -_ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC") -_JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'` -case "$host_os" in - darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'` - _JINC="$_JTOPDIR/Headers";; - *) _JINC="$_JTOPDIR/include";; -esac -if test -f "$_JINC/jni.h"; then - JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JINC" -else - _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'` - if test -f "$_JTOPDIR/include/jni.h"; then - JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JTOPDIR/include" - else - AC_MSG_ERROR([cannot find java include files]) - fi -fi - -# get the likely subdirectories for system specific java includes -case "$host_os" in -bsdi*) _JNI_INC_SUBDIRS="bsdos";; -linux*) _JNI_INC_SUBDIRS="linux genunix";; -osf*) _JNI_INC_SUBDIRS="alpha";; -solaris*) _JNI_INC_SUBDIRS="solaris";; -mingw*) _JNI_INC_SUBDIRS="win32";; -cygwin*) _JNI_INC_SUBDIRS="win32";; -*) _JNI_INC_SUBDIRS="genunix";; -esac - -# add any subdirectories that are present -for JINCSUBDIR in $_JNI_INC_SUBDIRS -do - if test -d "$_JTOPDIR/include/$JINCSUBDIR"; then - JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JTOPDIR/include/$JINCSUBDIR" - fi -done -]) - -# _ACJNI_FOLLOW_SYMLINKS <path> -# Follows symbolic links on <path>, -# finally setting variable _ACJNI_FOLLOWED -# -------------------- -AC_DEFUN([_ACJNI_FOLLOW_SYMLINKS],[ -# find the include directory relative to the javac executable -_cur="$1" -while ls -ld "$_cur" 2>/dev/null | grep " -> " >/dev/null; do - AC_MSG_CHECKING(symlink for $_cur) - _slink=`ls -ld "$_cur" | sed 's/.* -> //'` - case "$_slink" in - /*) _cur="$_slink";; - # 'X' avoids triggering unwanted echo options. - *) _cur=`echo "X$_cur" | sed -e 's/^X//' -e 's:[[^/]]*$::'`"$_slink";; - esac - AC_MSG_RESULT($_cur) -done -_ACJNI_FOLLOWED="$_cur" -])# _ACJNI diff --git a/m4/ac_prog_javac.m4 b/m4/ac_prog_javac.m4 deleted file mode 100644 index 87c5723..0000000 --- a/m4/ac_prog_javac.m4 +++ /dev/null @@ -1,84 +0,0 @@ -##### http://autoconf-archive.cryp.to/ac_prog_javac.html -# -# SYNOPSIS -# -# AC_PROG_JAVAC -# -# DESCRIPTION -# -# AC_PROG_JAVAC tests an existing Java compiler. It uses the -# environment variable JAVAC then tests in sequence various common -# Java compilers. For political reasons, it starts with the free -# ones. -# -# If you want to force a specific compiler: -# -# - at the configure.in level, set JAVAC=yourcompiler before calling -# AC_PROG_JAVAC -# -# - at the configure level, setenv JAVAC -# -# You can use the JAVAC variable in your Makefile.in, with @JAVAC@. -# -# *Warning*: its success or failure can depend on a proper setting of -# the CLASSPATH env. variable. -# -# TODO: allow to exclude compilers (rationale: most Java programs -# cannot compile with some compilers like guavac). -# -# Note: This is part of the set of autoconf M4 macros for Java -# programs. It is VERY IMPORTANT that you download the whole set, -# some macros depend on other. Unfortunately, the autoconf archive -# does not support the concept of set of macros, so I had to break it -# for submission. The general documentation, as well as the sample -# configure.in, is included in the AC_PROG_JAVA macro. -# -# LAST MODIFICATION -# -# 2000-07-19 -# -# COPYLEFT -# -# Copyright (c) 2000 Stephane Bortzmeyer <bortzmeyer@pasteur.fr> -# -# 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. -# -# As a special exception, the respective Autoconf Macro's copyright -# owner gives unlimited permission to copy, distribute and modify the -# configure scripts that are the output of Autoconf when processing -# the Macro. You need not follow the terms of the GNU General Public -# License when using or distributing such scripts, even though -# portions of the text of the Macro appear in them. The GNU General -# Public License (GPL) does govern all other use of the material that -# constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the -# Autoconf Macro released by the Autoconf Macro Archive. When you -# make and distribute a modified version of the Autoconf Macro, you -# may extend this special exception to the GPL to apply to your -# modified version as well. - -AC_DEFUN([AC_PROG_JAVAC],[ -AC_REQUIRE([AC_EXEEXT])dnl -if test "x$JAVAPREFIX" = x; then - test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, "gcj$EXEEXT -C" guavac$EXEEXT jikes$EXEEXT javac$EXEEXT) -else - test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, "gcj$EXEEXT -C" guavac$EXEEXT jikes$EXEEXT javac$EXEEXT, $JAVAPREFIX) -fi -test "x$JAVAC" = x && AC_MSG_ERROR([no acceptable Java compiler found in \$PATH]) -AC_PROG_JAVAC_WORKS -AC_PROVIDE([$0])dnl -]) diff --git a/m4/ac_prog_javac_works.m4 b/m4/ac_prog_javac_works.m4 deleted file mode 100644 index 5a16ca7..0000000 --- a/m4/ac_prog_javac_works.m4 +++ /dev/null @@ -1,75 +0,0 @@ -##### http://autoconf-archive.cryp.to/ac_prog_javac_works.html -# -# SYNOPSIS -# -# AC_PROG_JAVAC_WORKS -# -# DESCRIPTION -# -# Internal use ONLY. -# -# Note: This is part of the set of autoconf M4 macros for Java -# programs. It is VERY IMPORTANT that you download the whole set, -# some macros depend on other. Unfortunately, the autoconf archive -# does not support the concept of set of macros, so I had to break it -# for submission. The general documentation, as well as the sample -# configure.in, is included in the AC_PROG_JAVA macro. -# -# LAST MODIFICATION -# -# 2000-07-19 -# -# COPYLEFT -# -# Copyright (c) 2000 Stephane Bortzmeyer <bortzmeyer@pasteur.fr> -# -# 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. -# -# As a special exception, the respective Autoconf Macro's copyright -# owner gives unlimited permission to copy, distribute and modify the -# configure scripts that are the output of Autoconf when processing -# the Macro. You need not follow the terms of the GNU General Public -# License when using or distributing such scripts, even though -# portions of the text of the Macro appear in them. The GNU General -# Public License (GPL) does govern all other use of the material that -# constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the -# Autoconf Macro released by the Autoconf Macro Archive. When you -# make and distribute a modified version of the Autoconf Macro, you -# may extend this special exception to the GPL to apply to your -# modified version as well. - -AC_DEFUN([AC_PROG_JAVAC_WORKS],[ -AC_CACHE_CHECK([if $JAVAC works], ac_cv_prog_javac_works, [ -JAVA_TEST=Test.java -CLASS_TEST=Test.class -cat << \EOF > $JAVA_TEST -/* [#]line __oline__ "configure" */ -public class Test { -} -EOF -if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) >/dev/null 2>&1; then - ac_cv_prog_javac_works=yes -else - AC_MSG_ERROR([The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)]) - echo "configure: failed program was:" >&AC_FD_CC - cat $JAVA_TEST >&AC_FD_CC -fi -rm -f $JAVA_TEST $CLASS_TEST -]) -AC_PROVIDE([$0])dnl -]) diff --git a/m4/ax_pkg_swig.m4 b/m4/ax_pkg_swig.m4 deleted file mode 100644 index e112f3d..0000000 --- a/m4/ax_pkg_swig.m4 +++ /dev/null @@ -1,135 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_pkg_swig.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_PKG_SWIG([major.minor.micro], [action-if-found], [action-if-not-found]) -# -# DESCRIPTION -# -# This macro searches for a SWIG installation on your system. If found, -# then SWIG is AC_SUBST'd; if not found, then $SWIG is empty. If SWIG is -# found, then SWIG_LIB is set to the SWIG library path, and AC_SUBST'd. -# -# You can use the optional first argument to check if the version of the -# available SWIG is greater than or equal to the value of the argument. It -# should have the format: N[.N[.N]] (N is a number between 0 and 999. Only -# the first N is mandatory.) If the version argument is given (e.g. -# 1.3.17), AX_PKG_SWIG checks that the swig package is this version number -# or higher. -# -# As usual, action-if-found is executed if SWIG is found, otherwise -# action-if-not-found is executed. -# -# In configure.in, use as: -# -# AX_PKG_SWIG(1.3.17, [], [ AC_MSG_ERROR([SWIG is required to build..]) ]) -# AX_SWIG_ENABLE_CXX -# AX_SWIG_MULTI_MODULE_SUPPORT -# AX_SWIG_PYTHON -# -# LICENSE -# -# Copyright (c) 2008 Sebastian Huber <sebastian-huber@web.de> -# Copyright (c) 2008 Alan W. Irwin <irwin@beluga.phys.uvic.ca> -# Copyright (c) 2008 Rafael Laboissiere <rafael@laboissiere.net> -# Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za> -# Copyright (c) 2011 Murray Cumming <murrayc@openismus.com> -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 2 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 8 - -AC_DEFUN([AX_PKG_SWIG],[ - # Ubuntu has swig 2.0 as /usr/bin/swig2.0 - AC_PATH_PROGS([SWIG],[swig swig2.0]) - if test -z "$SWIG" ; then - m4_ifval([$3],[$3],[:]) - elif test -n "$1" ; then - AC_MSG_CHECKING([SWIG version]) - [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`] - AC_MSG_RESULT([$swig_version]) - if test -n "$swig_version" ; then - # Calculate the required version number components - [required=$1] - [required_major=`echo $required | sed 's/[^0-9].*//'`] - if test -z "$required_major" ; then - [required_major=0] - fi - [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] - [required_minor=`echo $required | sed 's/[^0-9].*//'`] - if test -z "$required_minor" ; then - [required_minor=0] - fi - [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] - [required_patch=`echo $required | sed 's/[^0-9].*//'`] - if test -z "$required_patch" ; then - [required_patch=0] - fi - # Calculate the available version number components - [available=$swig_version] - [available_major=`echo $available | sed 's/[^0-9].*//'`] - if test -z "$available_major" ; then - [available_major=0] - fi - [available=`echo $available | sed 's/[0-9]*[^0-9]//'`] - [available_minor=`echo $available | sed 's/[^0-9].*//'`] - if test -z "$available_minor" ; then - [available_minor=0] - fi - [available=`echo $available | sed 's/[0-9]*[^0-9]//'`] - [available_patch=`echo $available | sed 's/[^0-9].*//'`] - if test -z "$available_patch" ; then - [available_patch=0] - fi - # Convert the version tuple into a single number for easier comparison. - # Using base 100 should be safe since SWIG internally uses BCD values - # to encode its version number. - required_swig_vernum=`expr $required_major \* 10000 \ - \+ $required_minor \* 100 \+ $required_patch` - available_swig_vernum=`expr $available_major \* 10000 \ - \+ $available_minor \* 100 \+ $available_patch` - - if test $available_swig_vernum -lt $required_swig_vernum; then - AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version.]) - SWIG='' - m4_ifval([$3],[$3],[]) - else - AC_MSG_CHECKING([for SWIG library]) - SWIG_LIB=`$SWIG -swiglib` - AC_MSG_RESULT([$SWIG_LIB]) - m4_ifval([$2],[$2],[]) - fi - else - AC_MSG_WARN([cannot determine SWIG version]) - SWIG='' - m4_ifval([$3],[$3],[]) - fi - fi - AC_SUBST([SWIG_LIB]) -]) diff --git a/m4/ax_python_devel.m4 b/m4/ax_python_devel.m4 deleted file mode 100644 index a62b860..0000000 --- a/m4/ax_python_devel.m4 +++ /dev/null @@ -1,325 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_python_devel.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_PYTHON_DEVEL([version]) -# -# DESCRIPTION -# -# Note: Defines as a precious variable "PYTHON_VERSION". Don't override it -# in your configure.ac. -# -# This macro checks for Python and tries to get the include path to -# 'Python.h'. It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LDFLAGS) -# output variables. It also exports $(PYTHON_EXTRA_LIBS) and -# $(PYTHON_EXTRA_LDFLAGS) for embedding Python in your code. -# -# You can search for some particular version of Python by passing a -# parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". Please -# note that you *have* to pass also an operator along with the version to -# match, and pay special attention to the single quotes surrounding the -# version number. Don't use "PYTHON_VERSION" for this: that environment -# variable is declared as precious and thus reserved for the end-user. -# -# This macro should work for all versions of Python >= 2.1.0. As an end -# user, you can disable the check for the python version by setting the -# PYTHON_NOVERSIONCHECK environment variable to something else than the -# empty string. -# -# If you need to use this macro for an older Python version, please -# contact the authors. We're always open for feedback. -# -# LICENSE -# -# Copyright (c) 2009 Sebastian Huber <sebastian-huber@web.de> -# Copyright (c) 2009 Alan W. Irwin <irwin@beluga.phys.uvic.ca> -# Copyright (c) 2009 Rafael Laboissiere <rafael@laboissiere.net> -# Copyright (c) 2009 Andrew Collier <colliera@ukzn.ac.za> -# Copyright (c) 2009 Matteo Settenvini <matteo@member.fsf.org> -# Copyright (c) 2009 Horst Knorr <hk_classes@knoda.org> -# -# 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 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 8 - -AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL]) -AC_DEFUN([AX_PYTHON_DEVEL],[ - # - # Allow the use of a (user set) custom python version - # - AC_ARG_VAR([PYTHON_VERSION],[The installed Python - version to use, for example '2.3'. This string - will be appended to the Python interpreter - canonical name.]) - - AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]]) - if test -z "$PYTHON"; then - AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path]) - PYTHON_VERSION="" - fi - - # - # Check for a version of Python >= 2.1.0 - # - AC_MSG_CHECKING([for a version of Python >= '2.1.0']) - ac_supports_python_ver=`$PYTHON -c "import sys; \ - ver = sys.version.split ()[[0]]; \ - print (ver >= '2.1.0')"` - if test "$ac_supports_python_ver" != "True"; then - if test -z "$PYTHON_NOVERSIONCHECK"; then - AC_MSG_RESULT([no]) - AC_MSG_FAILURE([ -This version of the AC@&t@_PYTHON_DEVEL macro -doesn't work properly with versions of Python before -2.1.0. You may need to re-run configure, setting the -variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG, -PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand. -Moreover, to disable this check, set PYTHON_NOVERSIONCHECK -to something else than an empty string. -]) - else - AC_MSG_RESULT([skip at user request]) - fi - else - AC_MSG_RESULT([yes]) - fi - - # - # if the macro parameter ``version'' is set, honour it - # - if test -n "$1"; then - AC_MSG_CHECKING([for a version of Python $1]) - ac_supports_python_ver=`$PYTHON -c "import sys; \ - ver = sys.version.split ()[[0]]; \ - print (ver $1)"` - if test "$ac_supports_python_ver" = "True"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - AC_MSG_ERROR([this package requires Python $1. -If you have it installed, but it isn't the default Python -interpreter in your system path, please pass the PYTHON_VERSION -variable to configure. See ``configure --help'' for reference. -]) - PYTHON_VERSION="" - fi - fi - - # - # Check if you have distutils, else fail - # - AC_MSG_CHECKING([for the distutils Python package]) - ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` - if test -z "$ac_distutils_result"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - AC_MSG_ERROR([cannot import Python module "distutils". -Please check your Python installation. The error was: -$ac_distutils_result]) - PYTHON_VERSION="" - fi - - # - # Check for Python include path - # - AC_MSG_CHECKING([for Python include path]) - if test -z "$PYTHON_CPPFLAGS"; then - python_path=`$PYTHON -c "import distutils.sysconfig; \ - print (distutils.sysconfig.get_python_inc ());"` - if test -n "${python_path}"; then - python_path="-I$python_path" - fi - PYTHON_CPPFLAGS=$python_path - fi - AC_MSG_RESULT([$PYTHON_CPPFLAGS]) - AC_SUBST([PYTHON_CPPFLAGS]) - - # - # Check for Python library path - # - AC_MSG_CHECKING([for Python library path]) - if test -z "$PYTHON_LDFLAGS"; then - # (makes two attempts to ensure we've got a version number - # from the interpreter) - ac_python_version=`cat<<EOD | $PYTHON - - -# join all versioning strings, on some systems -# major/minor numbers could be in different list elements -from distutils.sysconfig import * -ret = '' -for e in get_config_vars ('VERSION'): - if (e != None): - ret += e -print (ret) -EOD` - - if test -z "$ac_python_version"; then - if test -n "$PYTHON_VERSION"; then - ac_python_version=$PYTHON_VERSION - else - ac_python_version=`$PYTHON -c "import sys; \ - print (sys.version[[:3]])"` - fi - fi - - # Make the versioning information available to the compiler - AC_DEFINE_UNQUOTED([HAVE_PYTHON], ["$ac_python_version"], - [If available, contains the Python version number currently in use.]) - - # First, the library directory: - ac_python_libdir=`cat<<EOD | $PYTHON - - -# There should be only one -import distutils.sysconfig -for e in distutils.sysconfig.get_config_vars ('LIBDIR'): - if e != None: - print (e) - break -EOD` - - # Before checking for libpythonX.Y, we need to know - # the extension the OS we're on uses for libraries - # (we take the first one, if there's more than one fix me!): - ac_python_soext=`$PYTHON -c \ - "import distutils.sysconfig; \ - print (distutils.sysconfig.get_config_vars('SO')[[0]])"` - - # Now, for the library: - ac_python_soname=`$PYTHON -c \ - "import distutils.sysconfig; \ - print (distutils.sysconfig.get_config_vars('LDLIBRARY')[[0]])"` - - # Strip away extension from the end to canonicalize its name: - ac_python_library=`echo "$ac_python_soname" | sed "s/${ac_python_soext}$//"` - - # This small piece shamelessly adapted from PostgreSQL python macro; - # credits goes to momjian, I think. I'd like to put the right name - # in the credits, if someone can point me in the right direction... ? - # - if test -n "$ac_python_libdir" -a -n "$ac_python_library" \ - -a x"$ac_python_library" != x"$ac_python_soname" - then - # use the official shared library - ac_python_library=`echo "$ac_python_library" | sed "s/^lib//"` - PYTHON_LDFLAGS="-L$ac_python_libdir -l$ac_python_library" - else - # old way: use libpython from python_configdir - ac_python_libdir=`$PYTHON -c \ - "from distutils.sysconfig import get_python_lib as f; \ - import os; \ - print (os.path.join(f(plat_specific=1, standard_lib=1), 'config'));"` - PYTHON_LDFLAGS="-L$ac_python_libdir -lpython$ac_python_version" - fi - - if test -z "PYTHON_LDFLAGS"; then - AC_MSG_ERROR([ - Cannot determine location of your Python DSO. Please check it was installed with - dynamic libraries enabled, or try setting PYTHON_LDFLAGS by hand. - ]) - fi - fi - AC_MSG_RESULT([$PYTHON_LDFLAGS]) - AC_SUBST([PYTHON_LDFLAGS]) - - # - # Check for site packages - # - AC_MSG_CHECKING([for Python site-packages path]) - if test -z "$PYTHON_SITE_PKG"; then - PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \ - print (distutils.sysconfig.get_python_lib(0,0));"` - fi - AC_MSG_RESULT([$PYTHON_SITE_PKG]) - AC_SUBST([PYTHON_SITE_PKG]) - - # - # libraries which must be linked in when embedding - # - AC_MSG_CHECKING(python extra libraries) - if test -z "$PYTHON_EXTRA_LIBS"; then - PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \ - conf = distutils.sysconfig.get_config_var; \ - print (conf('LOCALMODLIBS') + ' ' + conf('LIBS'))"` - fi - AC_MSG_RESULT([$PYTHON_EXTRA_LIBS]) - AC_SUBST(PYTHON_EXTRA_LIBS) - - # - # linking flags needed when embedding - # - AC_MSG_CHECKING(python extra linking flags) - if test -z "$PYTHON_EXTRA_LDFLAGS"; then - PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \ - conf = distutils.sysconfig.get_config_var; \ - print (conf('LINKFORSHARED'))"` - fi - AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS]) - AC_SUBST(PYTHON_EXTRA_LDFLAGS) - - # - # final check to see if everything compiles alright - # - AC_MSG_CHECKING([consistency of all components of python development environment]) - # save current global flags - ac_save_LIBS="$LIBS" - ac_save_CPPFLAGS="$CPPFLAGS" - LIBS="$ac_save_LIBS $PYTHON_LDFLAGS $PYTHON_EXTRA_LDFLAGS $PYTHON_EXTRA_LIBS" - CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS" - AC_LANG_PUSH([C]) - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[#include <Python.h>]], - [[Py_Initialize();]]) - ],[pythonexists=yes],[pythonexists=no]) - AC_LANG_POP([C]) - # turn back to default flags - CPPFLAGS="$ac_save_CPPFLAGS" - LIBS="$ac_save_LIBS" - - AC_MSG_RESULT([$pythonexists]) - - if test ! "x$pythonexists" = "xyes"; then - AC_MSG_FAILURE([ - Could not link test program to Python. Maybe the main Python library has been - installed in some non-standard library path. If so, pass it to configure, - via the LDFLAGS environment variable. - Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib" - ============================================================================ - ERROR! - You probably have to install the development version of the Python package - for your distribution. The exact name of this package varies among them. - ============================================================================ - ]) - PYTHON_VERSION="" - fi - - # - # all done! - # -]) diff --git a/m4/ax_swig_enable_cxx.m4 b/m4/ax_swig_enable_cxx.m4 deleted file mode 100644 index 348c15d..0000000 --- a/m4/ax_swig_enable_cxx.m4 +++ /dev/null @@ -1,53 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_swig_enable_cxx.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_SWIG_ENABLE_CXX -# -# DESCRIPTION -# -# Enable SWIG C++ support. This affects all invocations of $(SWIG). -# -# LICENSE -# -# Copyright (c) 2008 Sebastian Huber <sebastian-huber@web.de> -# Copyright (c) 2008 Alan W. Irwin <irwin@beluga.phys.uvic.ca> -# Copyright (c) 2008 Rafael Laboissiere <rafael@laboissiere.net> -# Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za> -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 2 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 6 - -AU_ALIAS([SWIG_ENABLE_CXX], [AX_SWIG_ENABLE_CXX]) -AC_DEFUN([AX_SWIG_ENABLE_CXX],[ - AC_REQUIRE([AX_PKG_SWIG]) - AC_REQUIRE([AC_PROG_CXX]) - SWIG="$SWIG -c++" -]) diff --git a/m4/ax_swig_multi_module_support.m4 b/m4/ax_swig_multi_module_support.m4 deleted file mode 100644 index f9c3842..0000000 --- a/m4/ax_swig_multi_module_support.m4 +++ /dev/null @@ -1,56 +0,0 @@ -# ================================================================================ -# http://www.gnu.org/software/autoconf-archive/ax_swig_multi_module_support.html -# ================================================================================ -# -# SYNOPSIS -# -# AX_SWIG_MULTI_MODULE_SUPPORT -# -# DESCRIPTION -# -# Enable support for multiple modules. This effects all invocations of -# $(SWIG). You have to link all generated modules against the appropriate -# SWIG runtime library. If you want to build Python modules for example, -# use the AX_SWIG_PYTHON macro and link the modules against -# $(AX_SWIG_PYTHON_LIBS). -# -# LICENSE -# -# Copyright (c) 2008 Sebastian Huber <sebastian-huber@web.de> -# Copyright (c) 2008 Alan W. Irwin <irwin@beluga.phys.uvic.ca> -# Copyright (c) 2008 Rafael Laboissiere <rafael@laboissiere.net> -# Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za> -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 2 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 7 - -AU_ALIAS([SWIG_MULTI_MODULE_SUPPORT], [AX_SWIG_MULTI_MODULE_SUPPORT]) -AC_DEFUN([AX_SWIG_MULTI_MODULE_SUPPORT],[ - AC_REQUIRE([AX_PKG_SWIG]) - SWIG="$SWIG -noruntime" -]) diff --git a/m4/ax_swig_python.m4 b/m4/ax_swig_python.m4 deleted file mode 100644 index 8fd3df5..0000000 --- a/m4/ax_swig_python.m4 +++ /dev/null @@ -1,64 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_swig_python.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_SWIG_PYTHON([use-shadow-classes = {no, yes}]) -# -# DESCRIPTION -# -# Checks for Python and provides the $(AX_SWIG_PYTHON_CPPFLAGS), and -# $(AX_SWIG_PYTHON_OPT) output variables. -# -# $(AX_SWIG_PYTHON_OPT) contains all necessary SWIG options to generate -# code for Python. Shadow classes are enabled unless the value of the -# optional first argument is exactly 'no'. If you need multi module -# support (provided by the AX_SWIG_MULTI_MODULE_SUPPORT macro) use -# $(AX_SWIG_PYTHON_LIBS) to link against the appropriate library. It -# contains the SWIG Python runtime library that is needed by the type -# check system for example. -# -# LICENSE -# -# Copyright (c) 2008 Sebastian Huber <sebastian-huber@web.de> -# Copyright (c) 2008 Alan W. Irwin <irwin@beluga.phys.uvic.ca> -# Copyright (c) 2008 Rafael Laboissiere <rafael@laboissiere.net> -# Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za> -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 2 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 7 - -AU_ALIAS([SWIG_PYTHON], [AX_SWIG_PYTHON]) -AC_DEFUN([AX_SWIG_PYTHON],[ - AC_REQUIRE([AX_PKG_SWIG]) - AC_REQUIRE([AX_PYTHON_DEVEL]) - test "x$1" != "xno" || swig_shadow=" -noproxy" - AC_SUBST([AX_SWIG_PYTHON_OPT],[-python$swig_shadow]) - AC_SUBST([AX_SWIG_PYTHON_CPPFLAGS],[$PYTHON_CPPFLAGS]) -]) diff --git a/src/Make.config b/src/Make.config new file mode 100644 index 0000000..75d5abe --- /dev/null +++ b/src/Make.config @@ -0,0 +1,7 @@ +NAME := xtract +DIRS := . c-ringbuf ooura dywapitchtrack +FLAGS := -I../include + +ifeq ($(PLATFORM), Darwin) + LDFLAGS = -framework Accelerate +endif diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..f120975 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,105 @@ +#### +#### Generic Makefile for C or C++ projects +#### +#### This file is public domain. +#### Jamie Bullock 2014 <jamie@jamiebullock.com> +#### + +################################### +### User configurable variables ### +################################### + +#### It is best not to modify this file +#### Instead override these variables in a separate Make.config file if needed + +# The name of the product to build (default uses parent directory name) +NAME ?= $(notdir $(CURDIR)) +# The file suffix of source files, can be .c or .cpp +SUFFIX ?= .c +# List of directories containing source files to be compiled +DIRS ?= . +# Flags to pass to the compiler for release builds +FLAGS ?= -O3 +# Flags to pass to the compiler for debug builds +DEBUG_FLAGS ?= -O0 -g +# Flags to pass to the linker +LDFLAGS ?= +# Type of product to build: "shared" for a shared library, "static" for a static library, empty for standalone +LIBRARY ?= static +# Prefix to the path that the "install" target will install into. libs to $(PREFIX)/lib, executables to $(PREFIX)/bin +PREFIX ?= /usr/local + +############################################## +### Do not modify anything below this line ### +############################################## + +ifeq ($(OS),Windows_NT) +else + PLATFORM := $(shell uname -s) +endif + +-include Make.config + +OUT_DIR := .build +SRC := $(foreach dir, $(DIRS), $(wildcard $(dir)/*$(SUFFIX))) +OBJ_ := $(SRC:$(SUFFIX)=.o) +OBJ := $(addprefix $(OUT_DIR)/,$(OBJ_)) +DEPS := $(OBJ:.o=.d) +SHARED_SUFFIX := dll +STATIC_SUFFIX := lib +INSTALL_DIR := $(PREFIX)/lib + +ifeq "$(PLATFORM)" "Darwin" + SHARED_SUFFIX := dylib + STATIC_SUFFIX := a +endif + +ifeq "$(PLATFORM)" "Linux" + SHARED_SUFFIX := so + STATIC_SUFFIX := a +endif + +ifeq "$(LIBRARY)" "shared" + OUT=lib$(NAME).$(SHARED_SUFFIX) + LDFLAGS += -shared +else ifeq "$(LIBRARY)" "static" + OUT=lib$(NAME).$(STATIC_SUFFIX) +else + OUT=$(NAME) + INSTALL_DIR := $(PREFIX)/bin +endif + +ifeq "$(SUFFIX)" ".cpp" + COMPILER := $(CXX) +else ifeq "$(SUFFIX)" ".c" + COMPILER := $(CC) +endif + +.SUFFIXES: +.PHONY: debug clean install uninstall + +$(OUT): $(OBJ) +ifeq "$(LIBRARY)" "static" + @$(AR) rcs $@ $^ +else + @$(COMPILER) $(LDFLAGS) $^ -o $@ +endif + +debug: FLAGS = $(DEBUG_FLAGS) +debug: $(OUT) + +$(OUT_DIR)/%.o: %$(SUFFIX) + @mkdir -p $(dir $@) + @$(COMPILER) $(CXXFLAGS) $(FLAGS) -MMD -MP -fPIC -c $< -o $@ + +install: $(OUT) + @install -d $(INSTALL_DIR) + @install $(OUT) $(INSTALL_DIR) + +uninstall: + @$(RM) $(INSTALL_DIR)/$(OUT) + +clean: + @$(RM) -r $(OUT) $(OUT_DIR) + +-include: $(DEPS) diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index 84cbb84..0000000 --- a/src/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -MAINTAINERCLEANFILES = Makefile.in - -if BUILD_OOURA -OOURA = ooura/fftsg.c -else -OOURA = -ACCELERATE_FLAGS = -framework Accelerate -endif - -SOURCES = libxtract.c \ - descriptors.c \ - scalar.c \ - vector.c \ - delta.c \ - init.c \ - window.c \ - fini.c \ - helper.c \ - stateful.c \ - c-ringbuf/ringbuf.c \ - dywapitchtrack/dywapitchtrack.c \ - $(OOURA) - -lib_LTLIBRARIES = libxtract.la -libxtract_la_CFLAGS = -libxtract_la_SOURCES = $(SOURCES) -libxtract_la_LDFLAGS = -export-dynamic $(ACCELERATE_FLAGS) - -EXTRA_DIST = xtract_globals_private.h \ - xtract_macros_private.h \ - xtract_window_private.h diff --git a/src/delta.c b/src/delta.c index c09c11a..1d6f8e9 100644 --- a/src/delta.c +++ b/src/delta.c @@ -24,7 +24,7 @@ /* xtract_delta.c: defines functions that extract a feature as a single value from more than one input vector */ #include <math.h> -#include "../xtract/libxtract.h" +#include "xtract/libxtract.h" int xtract_flux(const double *data, const int N, const void *argv , double *result) { diff --git a/src/descriptors.c b/src/descriptors.c index 2bfdd35..5caf9b2 100644 --- a/src/descriptors.c +++ b/src/descriptors.c @@ -21,7 +21,7 @@ * */ -#include "../xtract/libxtract.h" +#include "xtract/libxtract.h" #include "xtract_macros_private.h" #include <stdlib.h> #include <string.h> @@ -23,7 +23,7 @@ /* fini.c: Contains library destructor routine */ -#include "../xtract/libxtract.h" +#include "xtract/libxtract.h" #ifdef __GNUC__ __attribute__((destructor)) void fini() diff --git a/src/helper.c b/src/helper.c index 9b10294..93fd905 100644 --- a/src/helper.c +++ b/src/helper.c @@ -25,7 +25,7 @@ #include <stdio.h> -#include "../xtract/libxtract.h" +#include "xtract/libxtract.h" #ifdef WORDS_BIGENDIAN #define INDEX 0 @@ -33,7 +33,7 @@ #include "fft.h" -#include "../xtract/libxtract.h" +#include "xtract/libxtract.h" #include "xtract_window_private.h" #define DEFINE_GLOBALS #include "xtract_globals_private.h" diff --git a/src/libxtract.c b/src/libxtract.c index 168b106..692a528 100644 --- a/src/libxtract.c +++ b/src/libxtract.c @@ -21,7 +21,7 @@ * */ -#include "../xtract/libxtract.h" +#include "xtract/libxtract.h" #define XTRACT_H int(*xtract[])(const double *, const int, const void *, double *) = diff --git a/src/scalar.c b/src/scalar.c index 1182618..95b296b 100644 --- a/src/scalar.c +++ b/src/scalar.c @@ -36,8 +36,8 @@ #include "dywapitchtrack/dywapitchtrack.h" -#include "../xtract/libxtract.h" -#include "../xtract/xtract_helper.h" +#include "xtract/libxtract.h" +#include "xtract/xtract_helper.h" #include "xtract_macros_private.h" #include "xtract_globals_private.h" diff --git a/src/stateful.c b/src/stateful.c index 0b607bc..3d63786 100644 --- a/src/stateful.c +++ b/src/stateful.c @@ -23,8 +23,8 @@ /* stateful.c: declares functions that extract features that require stateful data to be retained between frames */ -#include "../xtract/xtract_stateful.h" -#include "../xtract/libxtract.h" +#include "xtract/xtract_stateful.h" +#include "xtract/libxtract.h" #include "c-ringbuf/ringbuf.h" diff --git a/src/vector.c b/src/vector.c index 9c49c2c..9588dea 100644 --- a/src/vector.c +++ b/src/vector.c @@ -30,7 +30,7 @@ #include "fft.h" -#include "../xtract/libxtract.h" +#include "xtract/libxtract.h" #include "xtract_macros_private.h" #include "xtract_globals_private.h" diff --git a/swig/Makefile b/swig/Makefile new file mode 100644 index 0000000..2d47e12 --- /dev/null +++ b/swig/Makefile @@ -0,0 +1,31 @@ +NAME = xtract + +OS := $(shell uname) + +# Assume that since we're building the python bindings, we have a python installed! +INCLUDEPY = $(shell python -m sysconfig | grep -w INCLUDEPY | awk '{print $$3}') + +ifeq ($(OS), Darwin) + CFLAGS=-g -c + LD=gcc + LDFLAGS=-bundle -flat_namespace -undefined suppress +else + CFLAGS=-g -c -fPIC + LD=ld + LDFLAGS=-shared +endif + +.PHONY: python + +python: + @swig -I../include -python $(NAME).i + @$(CC) $(CFLAGS) $(NAME)_wrap.c -o $(NAME)_wrap.o -I$(INCLUDEPY) -I../include + @$(CC) $(LDFLAGS) ../src/lib$(NAME).a $(NAME)_wrap.o -o _$(NAME).so -framework Accelerate + +clean: + @$(RM) *.o + @$(RM) *.pyc + @$(RM) *.so + @$(RM) $(NAME)_wrap.c + @$(RM) $(NAME).py + diff --git a/swig/Makefile.am b/swig/Makefile.am deleted file mode 100644 index 536bfed..0000000 --- a/swig/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -MAINTAINERCLEANFILES = Makefile.in - -if BUILD_JAVA -JAVA_BUILD_DIR = java -endif - -if BUILD_PYTHON -PYTHON_BUILD_DIR = python -endif - -SUBDIRS = $(JAVA_BUILD_DIR) $(PYTHON_BUILD_DIR) diff --git a/swig/java/Makefile.am b/swig/java/Makefile.am deleted file mode 100644 index 8205201..0000000 --- a/swig/java/Makefile.am +++ /dev/null @@ -1,101 +0,0 @@ -MAINTAINERCLEANFILES = all-local $(javasources) Makefile.in -TESTNAME = test -JAVA = java - -javasources = \ - SWIGTYPE_p_double.java \ - SWIGTYPE_p_int.java \ - SWIGTYPE_p_p_double.java \ - SWIGTYPE_p_unit_.java \ - SWIGTYPE_p_void.java \ - xtract_bool_t.java \ - xtractConstants.java \ - xtract_feature_init_.java \ - xtract_features_.java \ - xtract_feature_types_.java \ - xtract_function_descriptor_t_algo.java \ - xtract_function_descriptor_t_argv.java \ - xtract_function_descriptor_t_data.java \ - xtract_function_descriptor_t.java \ - xtract_function_descriptor_t_result.java \ - xtract_function_descriptor_t_result_scalar.java \ - xtract_function_descriptor_t_result_vector.java \ - xtract.java \ - xtractJNI.java \ - xtract_lnorm_filter_types_.java \ - xtract_mel_filter.java \ - xtract_mfcc_types_.java \ - xtract_return_codes_.java \ - xtract_spectrum_.java \ - xtract_type_t.java \ - xtract_unit_t.java \ - xtract_vector_t.java \ - xtract_window_types_.java - - - -javaclasses = \ - SWIGTYPE_p_double.class \ - SWIGTYPE_p_int.class \ - SWIGTYPE_p_p_double.class \ - SWIGTYPE_p_unit_.class \ - SWIGTYPE_p_void.class \ - xtract_bool_t.class \ - xtractConstants.class \ - xtract_feature_init_.class \ - xtract_features_.class \ - xtract_feature_types_.class \ - xtract_function_descriptor_t_algo.class \ - xtract_function_descriptor_t_argv.class \ - xtract_function_descriptor_t_data.class \ - xtract_function_descriptor_t.class \ - xtract_function_descriptor_t_result.class \ - xtract_function_descriptor_t_result_scalar.class \ - xtract_function_descriptor_t_result_vector.class \ - xtract.class \ - xtractJNI.class \ - xtract_lnorm_filter_types_.class \ - xtract_mel_filter.class \ - xtract_mfcc_types_.class \ - xtract_return_codes_.class \ - xtract_spectrum_.class \ - xtract_type_t.class \ - xtract_unit_t.class \ - xtract_vector_t.class \ - xtract_window_types_.class - -BUILT_SOURCES = xtract_wrap.c -SWIG_SOURCES = jxtract.i - -lib_LTLIBRARIES = libjxtract.la -libjxtract_la_SOURCES = $(BUILT_SOURCES) $(SWIG_SOURCES) -libjxtract_la_CFLAGS = $(SWIG_PYTHON_CPPFLAGS) -I$(top_srcdir)/src -libjxtract_la_LDFLAGS = -lxtract -libjxtract_la_LIBADD = $(top_srcdir)/src/libxtract.la - -SWIG_JAVA_OPT = -java -package xtract.core - -xtract_wrap.c: $(SWIG_SOURCES) - grep xtract_.*\(const $(top_srcdir)/xtract/xtract_* | grep argv | cut -d: -f 2 | sed 's/const void/void/g' > xtract_redeclare.i - $(SWIG) $(SWIG_JAVA_OPT) -I$(top_srcdir) -o $@ $< - mkdir -p xtract/core - mkdir -p xtract/core/src - mv $(javasources) xtract/core/src - -java-wrap: - cd xtract/core/src && $(JAVAC) $(javasources) - cd xtract/core/src && mv $(javaclasses) ../ - -test: - $(JAVAC) $(TESTNAME).java - -run: - $(JAVA) -Djava.library.path=.libs $(TESTNAME) - -all-local: java-wrap $(TESTNAME) - -clean-local: - -rm xtract_redeclare.i - -rm -f libjxtract.so xtract_wrap.c $(TESTNAME).class xtract_subband_scales_.java #$(javasources) $(javaclasses) $(nonautojavaclasses) $(TESTNAME).class xtract_subband_scales_.java - -rm -rf xtract - diff --git a/swig/java/jxtract.i b/swig/java/jxtract.i deleted file mode 100644 index 5c8c1db..0000000 --- a/swig/java/jxtract.i +++ /dev/null @@ -1,73 +0,0 @@ - -%include "../xtract.i" -%include "arrays_java.i" - -%apply double[] {const double *data}; -%apply double *OUTPUT { double *result }; -%typemap(in,numinputs=0) JNIEnv *env "$1 = jenv;" - -%javamethodmodifiers arr2voidd "private"; -%javamethodmodifiers arr2voidi "private"; -%javamethodmodifiers freearrd "private"; -%javamethodmodifiers freearri "private"; - -%inline %{ -jlong arr2voidd(JNIEnv *env, jdoubleArray arr) { - void *ptr = (*env)->GetFloatArrayElements(env, arr, NULL); - return (intptr_t)ptr; -} - -void freearrd(JNIEnv *env, jdoubleArray arr, jlong map) { - void *ptr = 0; - ptr = *(void **)↦ - (*env)->ReleaseFloatArrayElements(env, arr, ptr, JNI_ABORT); -} - -jlong arr2voidi(JNIEnv *env, jintArray arr) { - void *ptr = (*env)->GetIntArrayElements(env, arr, NULL); - return (intptr_t)ptr; -} - -void freearri(JNIEnv *env, jintArray arr, jlong map) { - void *ptr = 0; - ptr = *(void **)↦ - (*env)->ReleaseIntArrayElements(env, arr, ptr, JNI_ABORT); -} -%} - - -%pragma(java) modulecode=%{ - private static long arrPtr(Object o) { - if (o instanceof double[]) { - return arr2voidd((double[])o); - } - else if (o instanceof int[]) { - return arr2voidi((int[])o); - } - else if (o == null) { - return 0L; - } - throw new IllegalArgumentException(); - } - - private static void freeArrPtr(Object o, long addr) { - if (o instanceof double[]) { - freearrd((double[])o, addr); - return; - } - else if (o instanceof int[]) { - freearri((int[])o, addr); - return; - } - else if (o == null) { - return; - } - throw new IllegalArgumentException(); - } -%} - -%typemap(jstype) void *argv "Object" -%typemap(javain,pre=" long tmp$javainput = arrPtr($javainput);",post=" freeArrPtr($javainput, tmp$javainput);") void *argv "tmp$javainput" - -%include xtract_redeclare.i - diff --git a/swig/java/test.java b/swig/java/test.java deleted file mode 100644 index 82dd768..0000000 --- a/swig/java/test.java +++ /dev/null @@ -1,36 +0,0 @@ - -import xtract.core.*; -import java.util.Arrays; - -public class test { - public static void main(String argv[]) { - - try { - System.loadLibrary("jxtract"); - } - catch (UnsatisfiedLinkError e) { - System.out.println("Failed to load the library \"jxtract\""); - System.out.println(e.toString()); - System.exit(0); - } - - System.out.println("\nRunning libxtract Java bindings test...\n"); - - int len = 5; - int retval = 0; - double mean[] = new double[1]; - double variance[] = new double[1]; - double data[] = new double[len]; - - for (int i = 0; i < len; i++){ - System.out.print(i * 3 + ", "); - data[i] = i * 3; - } - - retval = xtract.xtract_mean(data, len, null, mean); - retval = xtract.xtract_variance(data, len, mean, variance); - - System.out.print("The mean of: " + Arrays.toString(data) + " is " - + mean[0] + "\nThe variance is: " + variance[0] + "\n"); - } -} diff --git a/swig/python/.gitignore b/swig/python/.gitignore deleted file mode 100644 index 6dfa0ae..0000000 --- a/swig/python/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -xtract.py -xtract_wrap.c
\ No newline at end of file diff --git a/swig/python/Makefile.am b/swig/python/Makefile.am deleted file mode 100644 index 833c2f3..0000000 --- a/swig/python/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -MAINTAINERCLEANFILES = xtract.py xtract_wrap.c Makefile.in _xtract.so - -BUILT_SOURCES = xtract_wrap.c -SWIG_SOURCES = ../xtract.i - -pkgpython_PYTHON = xtract.py __init__.py -pkgpyexec_LTLIBRARIES = _xtract.la -_xtract_la_SOURCES = $(BUILT_SOURCES) $(SWIG_SOURCES) -_xtract_la_CFLAGS = $(AX_SWIG_PYTHON_CPPFLAGS) -I$(top_srcdir)/src -_xtract_la_LDFLAGS = -module -_xtract_la_LIBADD = $(top_srcdir)/src/libxtract.la - -$(srcdir)/xtract_wrap.c : $(SWIG_SOURCES) - $(SWIG) $(AX_SWIG_PYTHON_OPT) -I$(top_srcdir) -o $@ $< - -clean-local: - -rm -f _xtract.so xtract.py xtract_wrap.c xtract.pyc - diff --git a/swig/python/__init__.py b/swig/python/__init__.py deleted file mode 100644 index e69de29..0000000 --- a/swig/python/__init__.py +++ /dev/null diff --git a/swig/python/test.py b/swig/test.py index a89a6f9..4d14171 100644 --- a/swig/python/test.py +++ b/swig/test.py @@ -1,7 +1,7 @@ #!/usr/bin/python try: - import libxtract.xtract as xtract + import xtract except ImportError: print 'Failed to load the library "xtract"' diff --git a/xtract/Makefile.am b/xtract/Makefile.am deleted file mode 100644 index ad79356..0000000 --- a/xtract/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -MAINTAINERCLEANFILES = Makefile.in - -libxtractdir = $(includedir)/xtract - -libxtract_HEADERS = libxtract.h xtract_macros.h xtract_types.h xtract_delta.h \ - xtract_scalar.h xtract_vector.h xtract_helper.h - |