From b46aca1241df7bf23bfce6c28b6db203525340ac Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Thu, 6 Nov 2014 17:18:02 +0000 Subject: Initial simplified build system based on GNU Make --- Make.config | 6 + Makefile.am | 27 --- README.md | 92 +--------- autogen.sh | 54 ------ bootstrap | 4 - configure.ac | 363 ------------------------------------- doc/Makefile.am | 30 --- examples/Makefile.am | 11 -- examples/puredata/Makefile.am | 27 --- examples/simpletest/Makefile.am | 8 - libxtract.pc.in | 10 - m4/ac_jni_include_dir.m4 | 112 ------------ m4/ac_prog_javac.m4 | 84 --------- m4/ac_prog_javac_works.m4 | 75 -------- m4/ax_pkg_swig.m4 | 135 -------------- m4/ax_python_devel.m4 | 325 --------------------------------- m4/ax_swig_enable_cxx.m4 | 53 ------ m4/ax_swig_multi_module_support.m4 | 56 ------ m4/ax_swig_python.m4 | 64 ------- src/Makefile.am | 31 ---- swig/Makefile.am | 11 -- swig/java/Makefile.am | 101 ----------- swig/python/Makefile.am | 18 -- xtract/Makefile.am | 7 - 24 files changed, 8 insertions(+), 1696 deletions(-) create mode 100644 Make.config delete mode 100644 Makefile.am delete mode 100755 autogen.sh delete mode 100644 bootstrap delete mode 100644 configure.ac delete mode 100644 doc/Makefile.am delete mode 100644 examples/Makefile.am delete mode 100644 examples/puredata/Makefile.am delete mode 100644 examples/simpletest/Makefile.am delete mode 100644 libxtract.pc.in delete mode 100644 m4/ac_jni_include_dir.m4 delete mode 100644 m4/ac_prog_javac.m4 delete mode 100644 m4/ac_prog_javac_works.m4 delete mode 100644 m4/ax_pkg_swig.m4 delete mode 100644 m4/ax_python_devel.m4 delete mode 100644 m4/ax_swig_enable_cxx.m4 delete mode 100644 m4/ax_swig_multi_module_support.m4 delete mode 100644 m4/ax_swig_python.m4 delete mode 100644 src/Makefile.am delete mode 100644 swig/Makefile.am delete mode 100644 swig/java/Makefile.am delete mode 100644 swig/python/Makefile.am delete mode 100644 xtract/Makefile.am diff --git a/Make.config b/Make.config new file mode 100644 index 0000000..036344a --- /dev/null +++ b/Make.config @@ -0,0 +1,6 @@ +NAME := xtract +DIRS := src src/c-ringbuf src/ooura src/dywapitchtrack + +ifeq ($(PLATFORM), Darwin) + LDFLAGS = -framework Accelerate +endif 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 - diff --git a/README.md b/README.md index 19be5ad..bdddb1f 100644 --- a/README.md +++ b/README.md @@ -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 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/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/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/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/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 -# -# 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 -# Follows symbolic links on , -# 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 -# -# 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 -# -# 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 -# Copyright (c) 2008 Alan W. Irwin -# Copyright (c) 2008 Rafael Laboissiere -# Copyright (c) 2008 Andrew Collier -# Copyright (c) 2011 Murray Cumming -# -# 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 . -# -# 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 -# Copyright (c) 2009 Alan W. Irwin -# Copyright (c) 2009 Rafael Laboissiere -# Copyright (c) 2009 Andrew Collier -# Copyright (c) 2009 Matteo Settenvini -# Copyright (c) 2009 Horst Knorr -# -# 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 . -# -# 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<]], - [[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 -# Copyright (c) 2008 Alan W. Irwin -# Copyright (c) 2008 Rafael Laboissiere -# Copyright (c) 2008 Andrew Collier -# -# 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 . -# -# 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 -# Copyright (c) 2008 Alan W. Irwin -# Copyright (c) 2008 Rafael Laboissiere -# Copyright (c) 2008 Andrew Collier -# -# 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 . -# -# 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 -# Copyright (c) 2008 Alan W. Irwin -# Copyright (c) 2008 Rafael Laboissiere -# Copyright (c) 2008 Andrew Collier -# -# 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 . -# -# 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/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/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/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/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 - -- cgit v1.2.3 From 24eb93e7c365ce8c775d7495ad528d3e33ea8033 Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Thu, 6 Nov 2014 17:29:10 +0000 Subject: Remove puredata and MaxMSP examples --- examples/MSP/Info.plist | 24 -- examples/MSP/Makefile | 59 ---- examples/MSP/PkgInfo | 1 - examples/MSP/test/magspec | 1 - examples/MSP/test/xtract-test.pat | 1 - examples/MSP/version.plist | 16 -- examples/MSP/xtract~.c | 337 ---------------------- examples/puredata/bark-example.pd | 52 ---- examples/puredata/harmonic_spectrum.pd | 108 -------- examples/puredata/lpcc-test.pd | 57 ---- examples/puredata/regression-test.pd | 84 ------ examples/puredata/simple-example.pd | 26 -- examples/puredata/simple-test.pd | 8 - examples/puredata/spectrum-512-test.pd | 8 - examples/puredata/subband_mean.pd | 102 ------- examples/puredata/subframe-test.pd | 131 --------- examples/puredata/tonality_from_subbands.pd | 160 ----------- examples/puredata/xtract/a_bavg.pd | 36 --- examples/puredata/xtract/a_blockswap~.pd | 43 --- examples/puredata/xtract/a_hann.pd | 30 -- examples/puredata/xtract/a_mton.pd | 66 ----- examples/puredata/xtract/a_output~.pd | 71 ----- examples/puredata/xtract/a_spigot~.pd | 21 -- examples/puredata/xtract/f0.pd | 302 -------------------- examples/puredata/xtract/mfcc.pd | 276 ------------------ examples/puredata/xtract/sonogram.pd | 1 - examples/puredata/xtract/xtract-help.pd | 42 --- examples/puredata/xtract~.c | 416 ---------------------------- 28 files changed, 2479 deletions(-) delete mode 100644 examples/MSP/Info.plist delete mode 100644 examples/MSP/Makefile delete mode 100644 examples/MSP/PkgInfo delete mode 100644 examples/MSP/test/magspec delete mode 100644 examples/MSP/test/xtract-test.pat delete mode 100644 examples/MSP/version.plist delete mode 100644 examples/MSP/xtract~.c delete mode 100644 examples/puredata/bark-example.pd delete mode 100644 examples/puredata/harmonic_spectrum.pd delete mode 100644 examples/puredata/lpcc-test.pd delete mode 100644 examples/puredata/regression-test.pd delete mode 100644 examples/puredata/simple-example.pd delete mode 100644 examples/puredata/simple-test.pd delete mode 100644 examples/puredata/spectrum-512-test.pd delete mode 100644 examples/puredata/subband_mean.pd delete mode 100644 examples/puredata/subframe-test.pd delete mode 100644 examples/puredata/tonality_from_subbands.pd delete mode 100644 examples/puredata/xtract/a_bavg.pd delete mode 100644 examples/puredata/xtract/a_blockswap~.pd delete mode 100644 examples/puredata/xtract/a_hann.pd delete mode 100644 examples/puredata/xtract/a_mton.pd delete mode 100644 examples/puredata/xtract/a_output~.pd delete mode 100644 examples/puredata/xtract/a_spigot~.pd delete mode 100644 examples/puredata/xtract/f0.pd delete mode 100644 examples/puredata/xtract/mfcc.pd delete mode 100644 examples/puredata/xtract/sonogram.pd delete mode 100644 examples/puredata/xtract/xtract-help.pd delete mode 100644 examples/puredata/xtract~.c 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 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - xtract~ - CFBundleIconFile - - CFBundleIdentifier - co.uk.postlude - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - iLaX - CFBundleSignature - max2 - CFBundleVersion - 1.0 - CSResourcesFileMapped - - - 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 @@ - - - - - BuildVersion - 38 - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1.0 - ProjectName - CarbonProjectTemplates - SourceVersion - 140000 - - 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 -#include - -#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/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~ ] \, where 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 -#include - -#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")); -} -- cgit v1.2.3 From f7bcd97626f1a990106e88e1dfcb56806dfb0419 Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Thu, 6 Nov 2014 17:29:37 +0000 Subject: Actually add Makefiles! - Not added in previous commit due to being in .gitignore --- .gitignore | 33 ---------------- Makefile | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++ examples/Make.config | 5 +++ examples/Makefile | 1 + 4 files changed, 111 insertions(+), 33 deletions(-) create mode 100644 Makefile create mode 100644 examples/Make.config create mode 120000 examples/Makefile diff --git a/.gitignore b/.gitignore index d092427..9361f92 100644 --- a/.gitignore +++ b/.gitignore @@ -22,39 +22,6 @@ examples/simpletest/simpletest *.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* diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f120975 --- /dev/null +++ b/Makefile @@ -0,0 +1,105 @@ +#### +#### Generic Makefile for C or C++ projects +#### +#### This file is public domain. +#### Jamie Bullock 2014 +#### + +################################### +### 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/Make.config b/examples/Make.config new file mode 100644 index 0000000..8713b3b --- /dev/null +++ b/examples/Make.config @@ -0,0 +1,5 @@ +DIRS := simpletest +LIBRARY := +SUFFIX := .cpp +FLAGS += -I../ +LDFLAGS = -lxtract -L.. diff --git a/examples/Makefile b/examples/Makefile new file mode 120000 index 0000000..d0b0e8e --- /dev/null +++ b/examples/Makefile @@ -0,0 +1 @@ +../Makefile \ No newline at end of file -- cgit v1.2.3 From df68c095949b4a5d1bad697e2785bd9cd8661f52 Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Fri, 7 Nov 2014 12:45:35 +0000 Subject: Add examples to new build system --- Make.config | 6 --- Makefile | 108 ++++------------------------------------ examples/Make.config | 5 -- examples/Makefile | 9 +++- examples/simpletest/Make.config | 9 ++++ examples/simpletest/Makefile | 105 ++++++++++++++++++++++++++++++++++++++ src/Make.config | 6 +++ src/Makefile | 105 ++++++++++++++++++++++++++++++++++++++ 8 files changed, 243 insertions(+), 110 deletions(-) delete mode 100644 Make.config delete mode 100644 examples/Make.config mode change 120000 => 100644 examples/Makefile create mode 100644 examples/simpletest/Make.config create mode 100644 examples/simpletest/Makefile create mode 100644 src/Make.config create mode 100644 src/Makefile diff --git a/Make.config b/Make.config deleted file mode 100644 index 036344a..0000000 --- a/Make.config +++ /dev/null @@ -1,6 +0,0 @@ -NAME := xtract -DIRS := src src/c-ringbuf src/ooura src/dywapitchtrack - -ifeq ($(PLATFORM), Darwin) - LDFLAGS = -framework Accelerate -endif diff --git a/Makefile b/Makefile index f120975..ece416f 100644 --- a/Makefile +++ b/Makefile @@ -1,105 +1,17 @@ -#### -#### Generic Makefile for C or C++ projects -#### -#### This file is public domain. -#### Jamie Bullock 2014 -#### -################################### -### User configurable variables ### -################################### +static: LIBTYPE = static +shared: LIBTYPE = shared -#### It is best not to modify this file -#### Instead override these variables in a separate Make.config file if needed +.PHONY: examples clean static shared -# 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 +all: static examples -############################################## -### Do not modify anything below this line ### -############################################## +static shared: + @$(MAKE) -C src LIBRARY=$(LIBTYPE) -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) +examples: + @$(MAKE) -C examples clean: - @$(RM) -r $(OUT) $(OUT_DIR) - --include: $(DEPS) + @$(MAKE) -C src clean + @$(MAKE) -C examples clean diff --git a/examples/Make.config b/examples/Make.config deleted file mode 100644 index 8713b3b..0000000 --- a/examples/Make.config +++ /dev/null @@ -1,5 +0,0 @@ -DIRS := simpletest -LIBRARY := -SUFFIX := .cpp -FLAGS += -I../ -LDFLAGS = -lxtract -L.. diff --git a/examples/Makefile b/examples/Makefile deleted file mode 120000 index d0b0e8e..0000000 --- a/examples/Makefile +++ /dev/null @@ -1 +0,0 @@ -../Makefile \ No newline at end of file diff --git a/examples/Makefile b/examples/Makefile new file mode 100644 index 0000000..46ef826 --- /dev/null +++ b/examples/Makefile @@ -0,0 +1,8 @@ + +.PHONY: simpletest clean + +simpletest: + @$(MAKE) -C $@ + +clean: + @$(MAKE) -C simpletest clean diff --git a/examples/simpletest/Make.config b/examples/simpletest/Make.config new file mode 100644 index 0000000..6d21ed7 --- /dev/null +++ b/examples/simpletest/Make.config @@ -0,0 +1,9 @@ + +ifeq ($(PLATFORM), Darwin) + DARWIN_LDFLAGS = -framework Accelerate +endif + +LIBRARY := +SUFFIX := .cpp +FLAGS += -I../../ +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 +#### + +################################### +### 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/Make.config b/src/Make.config new file mode 100644 index 0000000..036344a --- /dev/null +++ b/src/Make.config @@ -0,0 +1,6 @@ +NAME := xtract +DIRS := src src/c-ringbuf src/ooura src/dywapitchtrack + +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 +#### + +################################### +### 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) -- cgit v1.2.3 From 1491868aa5a263ac4724e690c0452a21dfbdf284 Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Fri, 7 Nov 2014 12:46:49 +0000 Subject: Fix bug in paths --- src/Make.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Make.config b/src/Make.config index 036344a..202c0ab 100644 --- a/src/Make.config +++ b/src/Make.config @@ -1,5 +1,5 @@ NAME := xtract -DIRS := src src/c-ringbuf src/ooura src/dywapitchtrack +DIRS := . c-ringbuf ooura dywapitchtrack ifeq ($(PLATFORM), Darwin) LDFLAGS = -framework Accelerate -- cgit v1.2.3 From fc4f132415391c0b5dd52072ce7e25473e06e3a9 Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Fri, 7 Nov 2014 12:49:21 +0000 Subject: Move xtract inside "include" directory --- include/xtract/libxtract.h | 440 +++++++++++++++++++++++++++++++++++ include/xtract/xtract_delta.h | 88 +++++++ include/xtract/xtract_helper.h | 109 +++++++++ include/xtract/xtract_macros.h | 47 ++++ include/xtract/xtract_scalar.h | 483 +++++++++++++++++++++++++++++++++++++++ include/xtract/xtract_stateful.h | 66 ++++++ include/xtract/xtract_types.h | 48 ++++ include/xtract/xtract_vector.h | 188 +++++++++++++++ xtract/libxtract.h | 440 ----------------------------------- xtract/xtract_delta.h | 88 ------- xtract/xtract_helper.h | 109 --------- xtract/xtract_macros.h | 47 ---- xtract/xtract_scalar.h | 483 --------------------------------------- xtract/xtract_stateful.h | 66 ------ xtract/xtract_types.h | 48 ---- xtract/xtract_vector.h | 188 --------------- 16 files changed, 1469 insertions(+), 1469 deletions(-) create mode 100644 include/xtract/libxtract.h create mode 100644 include/xtract/xtract_delta.h create mode 100644 include/xtract/xtract_helper.h create mode 100644 include/xtract/xtract_macros.h create mode 100644 include/xtract/xtract_scalar.h create mode 100644 include/xtract/xtract_stateful.h create mode 100644 include/xtract/xtract_types.h create mode 100644 include/xtract/xtract_vector.h delete mode 100644 xtract/libxtract.h delete mode 100644 xtract/xtract_delta.h delete mode 100644 xtract/xtract_helper.h delete mode 100644 xtract/xtract_macros.h delete mode 100644 xtract/xtract_scalar.h delete mode 100644 xtract/xtract_stateful.h delete mode 100644 xtract/xtract_types.h delete mode 100644 xtract/xtract_vector.h diff --git a/include/xtract/libxtract.h b/include/xtract/libxtract.h new file mode 100644 index 0000000..17540c5 --- /dev/null +++ b/include/xtract/libxtract.h @@ -0,0 +1,440 @@ +/* + * 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. + * + */ + +/** \mainpage + * + * LibXtract is a simple, portable, lightweight library of audio feature extraction functions. The purpose of the library is to provide a relatively exhaustive set of feature extraction primatives that are designed to be 'cascaded' to create a extraction hierarchies. + * For example, 'variance', 'average deviation', 'skewness' and 'kurtosis', all require the 'mean' of the input vector to be precomputed. However, rather than compute the 'mean' 'inside' each function, it is expected that the 'mean' will be passed in as an argument. This means that if the user wishes to use all of these features, the mean is calculated only once, and then passed to any functions that require it. + * + * This philosophy of 'cascading' features is followed throughout the library, for example with features that operate on the magnitude spectrum of a signal vector (e.g. 'irregularity'), the magnitude spectrum is not calculated 'inside' the respective function, instead, a pointer to the first element in an array containing the magnitude spectrum is passed in as an argument. + * + * Hopefully this not only makes the library more efficient when computing large numbers of features, but also makes it more flexible because extraction functions can be combined arbitrarily (one can take the irregularility of the Mel Frequency Cepstral Coefficients for example). + * + * All feature extraction functions follow the same prototype: + * + * **int xtract_function_name(const double *data, const int N, const void *argv, double *result);** + * + * \param const double *data points to an array of doubles representing the input data + * \param const int N represents the number of elementes from *data to be considered in the calculation + * \param const void *argv represents an arbitrary list of arguments. Used to pass in values required by the feature calculation + * \param double *result points to an array of doubles, or a single double represnting the result of the calculation + * + * + * It is up to the calling function to allocate enough memory for the *data, *argv, and *result, and to free it when required. Some feature extraction functions may also require an _init() function to be called in order to perform some initialisation. The struct xtract_function_descriptor_t is used to give an indication of recommended default values, and argc for the *argv array. + * + * LibXtract can be downloaded from http://www.sf.net/projects/libxtract + * + */ + +#ifndef XTRACT_H +#define XTRACT_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file libxtract.h + * \brief main header file and API definition + */ + +#include "xtract_scalar.h" +#include "xtract_vector.h" +#include "xtract_delta.h" +#include "xtract_types.h" +#include "xtract_macros.h" +#include "xtract_helper.h" + +/** \defgroup libxtract API + * + * Defines a very simple API that provides access to the functions in the library + * @{ + */ + +#define XTRACT_FEATURES 62 + +/** \brief Enumeration of features, elements are used as indixes to an array of pointers to feature extracton functions */ +enum xtract_features_ { + XTRACT_MEAN, + XTRACT_VARIANCE, + XTRACT_STANDARD_DEVIATION, + XTRACT_AVERAGE_DEVIATION, + XTRACT_SKEWNESS, + XTRACT_KURTOSIS, + XTRACT_SPECTRAL_MEAN, + XTRACT_SPECTRAL_VARIANCE, + XTRACT_SPECTRAL_STANDARD_DEVIATION, + /*XTRACT_SPECTRAL_AVERAGE_DEVIATION, */ + XTRACT_SPECTRAL_SKEWNESS, + XTRACT_SPECTRAL_KURTOSIS, + XTRACT_SPECTRAL_CENTROID, + XTRACT_IRREGULARITY_K, + XTRACT_IRREGULARITY_J, + XTRACT_TRISTIMULUS_1, + XTRACT_TRISTIMULUS_2, + XTRACT_TRISTIMULUS_3, + XTRACT_SMOOTHNESS, + XTRACT_SPREAD, + XTRACT_ZCR, + XTRACT_ROLLOFF, + XTRACT_LOUDNESS, + XTRACT_FLATNESS, + XTRACT_FLATNESS_DB, + XTRACT_TONALITY, + XTRACT_CREST, + XTRACT_NOISINESS, + XTRACT_RMS_AMPLITUDE, + XTRACT_SPECTRAL_INHARMONICITY, + XTRACT_POWER, + XTRACT_ODD_EVEN_RATIO, + XTRACT_SHARPNESS, + XTRACT_SPECTRAL_SLOPE, + XTRACT_LOWEST_VALUE, + XTRACT_HIGHEST_VALUE, + XTRACT_SUM, + XTRACT_NONZERO_COUNT, + XTRACT_HPS, + XTRACT_F0, + XTRACT_FAILSAFE_F0, + XTRACT_WAVELET_F0, + XTRACT_MIDICENT, + XTRACT_LNORM, + XTRACT_FLUX, + XTRACT_ATTACK_TIME, + XTRACT_DECAY_TIME, + XTRACT_DIFFERENCE_VECTOR, + XTRACT_AUTOCORRELATION, + XTRACT_AMDF, + XTRACT_ASDF, + XTRACT_BARK_COEFFICIENTS, + XTRACT_PEAK_SPECTRUM, + XTRACT_SPECTRUM, + XTRACT_AUTOCORRELATION_FFT, + XTRACT_MFCC, + XTRACT_DCT, + XTRACT_HARMONIC_SPECTRUM, + XTRACT_LPC, + XTRACT_LPCC, + XTRACT_SUBBANDS, + /* Helper functions */ + XTRACT_WINDOWED, + XTRACT_SMOOTHED +}; + +/** \brief Enumeration of feature initialisation functions */ +enum xtract_feature_init_ { + XTRACT_INIT_MFCC = 100, + XTRACT_INIT_BARK, + XTRACT_INIT_WINDOWED +}; + +/** \brief Enumeration of feature types */ +enum xtract_feature_types_ { + XTRACT_SCALAR, + XTRACT_VECTOR, + XTRACT_DELTA +}; + +/** \brief Enumeration of mfcc types */ +enum xtract_mfcc_types_ { + XTRACT_EQUAL_GAIN, + XTRACT_EQUAL_AREA +}; + +enum xtract_lnorm_filter_types_ { + XTRACT_NO_LNORM_FILTER, + XTRACT_POSITIVE_SLOPE, + XTRACT_NEGATIVE_SLOPE +}; + +/** \brief Enumeration of return codes */ +enum xtract_return_codes_ { + XTRACT_SUCCESS, + XTRACT_MALLOC_FAILED, + XTRACT_BAD_ARGV, + XTRACT_BAD_VECTOR_SIZE, + XTRACT_BAD_STATE, + XTRACT_DENORMAL_FOUND, + XTRACT_NO_RESULT, /* This usually occurs when the correct calculation cannot take place because required data is missing or would result in a NaN or infinity/-infinity. Under these curcumstances 0.f is usually given by *result */ + XTRACT_FEATURE_NOT_IMPLEMENTED, + XTRACT_ARGUMENT_ERROR +}; + +/** \brief Enumeration of spectrum types */ +enum xtract_spectrum_ { + XTRACT_MAGNITUDE_SPECTRUM, + XTRACT_LOG_MAGNITUDE_SPECTRUM, + XTRACT_POWER_SPECTRUM, + XTRACT_LOG_POWER_SPECTRUM +}; + +/** \brief Subband scales */ +enum xtract_subband_scales_ { + XTRACT_OCTAVE_SUBBANDS, + XTRACT_LINEAR_SUBBANDS +}; + +/** \brief Enumeration of data types*/ +typedef enum type_ { + XTRACT_FLOAT, + XTRACT_FLOATARRAY, + XTRACT_INT, + XTRACT_MEL_FILTER +} xtract_type_t; + +/** \brief Enumeration of units*/ +typedef enum unit_ { + /* NONE, ANY */ + XTRACT_HERTZ = 2, + XTRACT_ANY_AMPLITUDE_HERTZ, + XTRACT_DBFS, + XTRACT_DBFS_HERTZ, + XTRACT_PERCENT, + XTRACT_BINS, + XTRACT_SONE, + XTRACT_MIDI_CENT +} xtract_unit_t; + +/** \brief Boolean */ +typedef enum { + XTRACT_FALSE, + XTRACT_TRUE +} xtract_bool_t; + +/** \brief Window types */ +enum xtract_window_types_ { + XTRACT_GAUSS, + XTRACT_HAMMING, + XTRACT_HANN, + XTRACT_BARTLETT, + XTRACT_TRIANGULAR, + XTRACT_BARTLETT_HANN, + XTRACT_BLACKMAN, + XTRACT_KAISER, + XTRACT_BLACKMAN_HARRIS +}; + +/** \brief Enumeration of vector format types*/ +typedef enum xtract_vector_ { + /* N/2 magnitude/log-magnitude/power/log-power coeffs and N/2 frequencies */ + XTRACT_SPECTRAL, + /* N spectral amplitudes */ + XTRACT_SPECTRAL_MAGNITUDES, + /* N/2 magnitude/log-magnitude/power/log-power peak coeffs and N/2 + * frequencies */ + XTRACT_SPECTRAL_PEAKS, + /* N spectral peak amplitudes */ + XTRACT_SPECTRAL_PEAKS_MAGNITUDES, + /* N spectral peak frequencies */ + XTRACT_SPECTRAL_PEAKS_FREQUENCIES, + /* N/2 magnitude/log-magnitude/power/log-power harmonic peak coeffs and N/2 + * frequencies */ + XTRACT_SPECTRAL_HARMONICS, + /* N spectral harmonic amplitudes */ + XTRACT_SPECTRAL_HARMONICS_MAGNITUDES, + /* N spectral harmonic frequencies */ + XTRACT_SPECTRAL_HARMONICS_FREQUENCIES, + XTRACT_AUTOCORRELATION_COEFFS, + XTRACT_ARBITRARY_SERIES, + XTRACT_AUDIO_SAMPLES, + XTRACT_MEL_COEFFS, + XTRACT_LPC_COEFFS, + XTRACT_LPCC_COEFFS, + XTRACT_BARK_COEFFS, + XTRACT_SUBFRAMES, + XTRACT_NO_DATA +} xtract_vector_t; + +/** \brief Data structure containing useful information about functions provided by LibXtract. */ +typedef struct _xtract_function_descriptor { + + int id; + + struct { + char name[XTRACT_MAX_NAME_LENGTH]; + char p_name[XTRACT_MAX_NAME_LENGTH]; /* pretty name */ + char desc[XTRACT_MAX_DESC_LENGTH]; + char p_desc[XTRACT_MAX_DESC_LENGTH]; /* pretty description */ + char author[XTRACT_MAX_AUTHOR_LENGTH]; + int year; + } algo; + + struct { + xtract_vector_t format; + xtract_unit_t unit; + } data; + + int argc; + + struct { + xtract_type_t type; /* type of the array/value pointed to by argv */ + double min[XTRACT_MAXARGS]; + double max[XTRACT_MAXARGS]; + double def[XTRACT_MAXARGS]; /* defaults */ + xtract_unit_t unit[XTRACT_MAXARGS]; + int donor[XTRACT_MAXARGS]; /* suggested donor functions for argv */ + } argv; + + xtract_bool_t is_scalar; + xtract_bool_t is_delta; /* features in xtract_delta.h can be scalar or vector */ + + /* The result.<> entries in descritors.c need to be checked */ + union { + + struct { + double min; + double max; + xtract_unit_t unit; + } scalar; + + struct { + xtract_vector_t format; + xtract_unit_t unit; + } vector; + + } result; + +} xtract_function_descriptor_t; + +/** + * + * \brief An array of pointers to functions that perform the extraction + * + * \param *data: a pointer to the start of the input data (usually the first element in an array) + * + * \param N: the number of elements to be processed + * + * \param *argv: an abitrary number of additional arguments, used to pass additional parameters to the function being called. All arguments are compulsary! + * + * \param *result: a pointer to the first element in the result + * + * Each function will iterate over N array elements, the first of which is + * pointed to by *data. It is up to the calling function to ensure that the array is in the format expected by the function being called. + * + * For scalar and delta features, *result will point to a single value. + * + * For vector features it will point to the first element in an array. + * + * Memory for this array must be allocated and freed by the calling + * function. + * + * All functions return an integer error code as descibed in the enumeration + * return_codes_ + * + * The preprocessor macro: XTRACT must be defined before this can be used + * + * example:
+ * \verbatim +#include +#define XTRACT +#include "libxtract.h" + +main () { +double values[] = {1.0, 2.0, 3.0, 4.0, 5.0}; +int N = 5; +double mean; + +xtract[MEAN]((void *)values, N, NULL, &mean); + +printf("Mean = %.2f\n", mean); +} +\endverbatim + * The calling function may additionally make some tests against the value returned by xtract + * + */ +#ifdef XTRACT_H +extern int(*xtract[XTRACT_FEATURES])(const double *data, const int N, const void *argv, double *result); + +#endif + +/** \brief A function to initialise wavelet f0 detector state */ +int xtract_init_wavelet_f0_state(void); + +/** \brief A structure to store a set of n_filters Mel filters */ +typedef struct xtract_mel_filter_ { + int n_filters; + double **filters; +} xtract_mel_filter; + +/** \brief A function to initialise a mel filter bank + * + * It is up to the caller to pass in a pointer to memory allocated for freq_bands arrays of length N. This function populates these arrays with magnitude coefficients representing the mel filterbank on a linear scale + */ +int xtract_init_mfcc(int N, double nyquist, int style, double freq_min, double freq_max, int freq_bands, double **fft_tables); + +/** \brief A function to initialise bark filter bounds + * + * A pointer to an array of BARK_BANDS ints most be passed in, and is populated with BARK_BANDS fft bin numbers representing the limits of each band + * + * \param N: the audio block size + * \param sr: The sample audio sample rate + * \param *band_limits: a pointer to an array of BARK_BANDS ints + */ +int xtract_init_bark(int N, double sr, int *band_limits); + +/** \brief An initialisation function for functions using FFT + * + * This function initialises global data structures used by functions requiring FFT functionality. It can be called multiple times with different feature names. Calling it more than once with the same feature name is not a valid operation and will result in a memory leak. + * + * \param N: the size of the FFT + * \param feature_name: the name of the feature the FFT is being used for, + * e.g. XTRACT_DCT + * + */ +int xtract_init_fft(int N, int feature_name); + +/** \brief Free memory used for fft plans + * + * This function should be used to explicitly free memory allocated for ffts by xtract_init_fft(). It is primarily intended for use if a new FFT needs to be taken with a different blocksize. If only one fft size is required then there is no need to call this function since it will be called when the program exits. + * */ +void xtract_free_fft(void); + +/** \brief Make a window of a given type and return a pointer to it + * + * \param N: the size of the window + * \param type: the type of the window as given in the enumeration window_types_ + * + */ +double *xtract_init_window(const int N, const int type); + +/** \brief Free a window as allocated by xtract_make_window() + * + * \param *window: a pointer to an array of doubles as allocated by xtract_make_window() + * + */ +void xtract_free_window(double *window); + +/* \brief A function to build an array of function descriptors */ +xtract_function_descriptor_t *xtract_make_descriptors(); + +/* \brief A function to free an array of function descriptors */ +int xtract_free_descriptors(xtract_function_descriptor_t *fd); +/* Free functions */ + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/xtract/xtract_delta.h b/include/xtract/xtract_delta.h new file mode 100644 index 0000000..c7b3ee7 --- /dev/null +++ b/include/xtract/xtract_delta.h @@ -0,0 +1,88 @@ +/* + * 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. + * + */ + +/** \file xtract_delta.h: declares functions that scalar or vector value from 2 or more input vectors */ + +#ifndef XTRACT_DELTA_H +#define XTRACT_DELTA_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup delta `delta' extraction functions + * + * Functions that extract a scalar or vector value from 2 or more input vectors + * + * @{ + */ + +#include "xtract_types.h" + +/** \brief Extract flux + * + * \note FIX: don't be lazy -- take the lnorm of the difference vector! + * An alias for xtract_lnorm() + */ +int xtract_flux(const double *data, const int N, const void *argv , double *result); + +/** \brief Extract the L-norm of a vector + * + * \param *data: a pointer to the first element in an array of doubles representing the difference between two subsequent frames of output from a vector-based feature e.g. the *result from xtract_difference_vector() + * \param N: the length of the array pointed to by *data + * \param *argv: a pointer to an array of doubles, the first representing the "norm order". The second argument represents the filter type determining what values we consider from the difference vector as given in the enumeration xtract_lnorm_filter_types_ (libxtract.h), the third sets whether we want the result to be normalised in the range 0-1 (0 = no normalise, 1 = normalise) + * \param *result: a pointer to a double representing the flux + * + */ +int xtract_lnorm(const double *data, const int N, const void *argv , double *result); +/*xtract_frame_tracker *xf */ + +/** \brief Extract attack Time */ +int xtract_attack_time(const double *data, const int N, const void *argv , double *result); +/* xtract_amp_tracker *xa */ + +/** Extract temporal decrease */ +int xtract_decay_time(const double *data, const int N, const void *argv, double *result); +/* xtract_amp_tracker *xa */ + + +/** \brief Extract the difference between two vectors + * + * \param *data a pointer to an array representing two distinct vectors, e.g. two successive magnitude spectra. + * \param N the size of the array pointed to by *data + * \param *argv a pointer to NULL + * \param *result a pointer to an array of size N / 2 representing the difference between the two input vectors. + * + * */ +int xtract_difference_vector(const double *data, const int N, const void *argv, double *result); +/*xtract_frame_tracker *xf */ +/*double frames*/ + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/xtract/xtract_helper.h b/include/xtract/xtract_helper.h new file mode 100644 index 0000000..7296f0e --- /dev/null +++ b/include/xtract/xtract_helper.h @@ -0,0 +1,109 @@ +/* + * 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. + * + */ + +/** \file xtract_helper.h: helper functions for making life with libxtract a bit more bearable */ + +#ifndef XTRACT_HELPER_H +#define XTRACT_HELPER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef _MSC_VER + #ifndef __cplusplus + typedef int bool; + #define false 0 + #define true 1 + #endif +#else + #include +#endif + + +/** + * \defgroup helper helper functions + * + * Declares helper functions, and their parameters. + * + * \note These functions don't necessarily conform to the prototype used in xtract_scalar.h and xtract_vector.h etc, and as such are intended to be called 'directly' rather than via the xtract[] function pointer array (libxtract.h) + * + * @{ + */ + +/** \brief Apply a window function to an array of length N + * + * \param *data a pointer to an array of doubles + * \param N the number of elements in the array pointed to by *data + * \param *argv a pointer to a window function as returned by xtract_make_window() + * \param *result a pointer to the first element an array containing the windowed data + * + * It is up to the caller to generate and free the array containing the window, and to allocate and free memory of size N to hold the data pointed to by *result + * + */ +int xtract_windowed(const double *data, const int N, const void *argv, double *result); + +/** \brief Divides the array pointed to by *data into two subframes, and applies a given feature to each subframe, returning them in a single array pointed to by result + * + * \param *data an array of doubles + * \param N the number of elements in the array pointed by *data + * \param feature an integer representing the feature to be applied to each subframe in data. This will be a value as given in the enumeration xtract_features_ (libxtract.h) + * \param *argv a pointer to the argument vector to be passed to the feature extraction function as determined by feature + * \param *result a pointer to the 'packed' results of the feature calculation. This may be passed in as *data to xtract_features_from_subframes() to calculate further features on the subframes, or xtract_difference_vector(), to get the difference between the subframes. + * + * + * It is important to ensure that any _init_*() functions that are called in preparation for functions that are called on subframes are given the subframe size as 'N', and not the frame size. i.e. if xtract_features_from_subframes() is called with N=64, and feature=XTRACT_SPECTRUM, then xtract_init_fft() should be called with N=32. + * + */ +int xtract_features_from_subframes(const double *data, const int N, const int feature, const void *argv, double *result); + +/** \brief Test whether a number is denormal */ +int xtract_is_denormal(double const d); + +/** \brief Test whether a number is a power of two */ +bool xtract_is_poweroftwo(unsigned int x); + + +/** \brief Smooth a vector + * + * \param *data a pointer to an array of doubles + * \param N the number of elements in the array pointed to by *data to be smoothed + * \param *argv a pointer to a double giving the smoothing gain + * \param *result a pointer to the first element an array containing the smoothed data + * + * \note if passing in a spectrum e.g. *result from xtract_spectrum(), then N for xtract_smoothed() should be N / 2 with respect to the N for xtract_spectrum() so only amplitude components are smoothed, not frequencies! + * + */ + int xtract_smoothed(const double *data, const int N, const void *argv, double *result); + + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif + + + diff --git a/include/xtract/xtract_macros.h b/include/xtract/xtract_macros.h new file mode 100644 index 0000000..3445866 --- /dev/null +++ b/include/xtract/xtract_macros.h @@ -0,0 +1,47 @@ +/* + * 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. + * + */ + +/** \file xtract_macros.h: defines useful public macros */ + +#ifndef XTRACT_MACROS_H +#define XTRACT_MACROS_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define XTRACT_BARK_BANDS 26 +#define XTRACT_WINDOW_SIZE 1024/* dummy macro for descriptors where argc is window size */ +#define XTRACT_NONE 0 +#define XTRACT_ANY -1 +#define XTRACT_UNKNOWN -2 +#define XTRACT_MAXARGS 4 +#define XTRACT_MAX_NAME_LENGTH 64 +#define XTRACT_MAX_AUTHOR_LENGTH 128 +#define XTRACT_MAX_DESC_LENGTH 256 + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/xtract/xtract_scalar.h b/include/xtract/xtract_scalar.h new file mode 100644 index 0000000..8e24284 --- /dev/null +++ b/include/xtract/xtract_scalar.h @@ -0,0 +1,483 @@ +/* + * 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. + * + */ + +/** \file xtract_scalar.h: declares functions that extract a feature as a single value from an input vector */ + +#ifndef XTRACT_SCALAR_H +#define XTRACT_SCALAR_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup scalar scalar extraction functions + * + * Functions that extract a feature as a single value from an input vector + * + * @{ + */ + +/** \brief Extract the mean of an input vector + * + * \param *data: a pointer to the first element + * \param N: the number of array elements to be considered + * \param *argv: a pointer to NULL + * \param *result: the mean of N values from the array pointed to by *data + */ +int xtract_mean(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the variance of an input vector + * + * \param *data: a pointer to the first element in an array of doubles + * \param N: the number of elements to be considered + * \param *argv: a pointer to a double representing the mean of the input vector + * \param *result: the variance of N values from the array pointed to by *data + */ +int xtract_variance(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the deviation of an input vector + * + * \param *data: a pointer to the first element in an array of doubles + * \param N: the number of elements to be considered + * \param *argv: a pointer to a double representing the variance of the input vector + * \param *result: the deviation of N values from the array pointed to by *data + */ +int xtract_standard_deviation(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the average deviation of an input vector + * + * \param *data: a pointer to the first element in an array of doubles + * \param N: the number of elements to be considered + * \param *argv: a pointer to a double representing the mean of the input vector + * \param *result: the average deviation of N values from the array pointed to by *data + */ +int xtract_average_deviation(const double *data, const int N, const void *argv, double *result); + + +/** \brief Extract the skewness of an input vector + * + * \param *data: a pointer to the first element in an array of doubles + * \param N: the number of elements to be considered + * \param *argv: a pointer to an array of doubles representing the mean and standard deviation of the input vector + * \param *result: the skewness of N values from the array pointed to by *data + */ +int xtract_skewness(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the kurtosis of an input vector + * + * \param *data: a pointer to the first element in an array of doubles + * \param N: the number of elements to be considered + * \param *argv: a pointer to an array of values representing the mean and standard deviation of the input vector + * \param *result: the kurtosis of N values from the array pointed to by *data + */ +int xtract_kurtosis(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the mean of an input spectrum + * + * \param *data: a pointer to the first element in an array of doubles representing the spectrum of an audio vector, (e.g. the array pointed to by *result from xtract_spectrum(), xtract_peak_spectrum() or xtract_harmonic_spectrum()). + * \param N: the size of the array pointed to by *data + * \param *argv: a pointer to NULL + * \param *result: the mean of the spectrum pointed to by *data + */ +int xtract_spectral_mean(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the variance of an input spectrum + * + * \param *data: a pointer to the first element in an array of doubles representing the spectrum of an audio vector, (e.g. the array pointed to by *result from xtract_spectrum(), xtract_peak_spectrum() or xtract_harmonic_spectrum()). + * \param N: the number of elements to be considered + * \param N: the size of the array pointed to by *data + * \param *argv: a pointer to a double representing the spectral mean of the input spectrum + * \param *result: the variance of the spectrum pointed to by *data + */ +int xtract_spectral_variance(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the deviation of an input spectrum + * + * \param *data: a pointer to the first element in an array of doubles representing the spectrum of an audio vector, (e.g. the array pointed to by *result from xtract_spectrum(), xtract_peak_spectrum() or xtract_harmonic_spectrum()). + * \param N: the size of the array pointed to by *data + * \param *argv: a pointer to a double representing the spectral variance of the input spectrum + * \param *result: the deviation of the spectrum pointed to by *data + */ +int xtract_spectral_standard_deviation(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the average deviation of an input spectrum + * + * \param *data: a pointer to the first element in an array of doubles representing the spectrum of an audio vector, (e.g. the array pointed to by *result from xtract_spectrum(), xtract_peak_spectrum() or xtract_harmonic_spectrum()). + * \param N: the size of the array pointed to by *data + * \param *argv: a pointer to a double representing the spectral mean of the input spectrum + * \param *result: the average deviation of the spectrum pointed to by *data + */ +/* +int xtract_spectral_average_deviation(const double *data, const int N, const void *argv, double *result); +*/ + +/** \brief Extract the skewness of an input spectrum + * + * \param *data: a pointer to the first element in an array of doubles representing the spectrum of an audio vector, (e.g. the array pointed to by *result from xtract_spectrum(), xtract_peak_spectrum() or xtract_harmonic_spectrum()). + * \param N: the size of the array pointed to by *data + * \param *argv: a pointer to an array of doubles representing the spectral mean and spectral standard deviation of the input spectrum + * \param *result: the skewness of the spectrum pointed to by *data + */ +int xtract_spectral_skewness(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the kurtosis of an input spectrum + * + * \param *data: a pointer to the first element in an array of doubles representing the spectrum of an audio vector, (e.g. the array pointed to by *result from xtract_spectrum(), xtract_peak_spectrum() or xtract_harmonic_spectrum()). + * \param N: the size of the array pointed to by *data + * \param *argv: a pointer to an array of values representing the spectral mean and spectral standard deviation of the input spectrum + * \param *result: the kurtosis of the spectrum pointed to by *data + */ +int xtract_spectral_kurtosis(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the centroid of an input vector + * + * \param *data: a pointer to the first element in an array of doubles representing the spectrum of an audio vector, (e.g. the array pointed to by *result from xtract_spectrum(), xtract_peak_spectrum() or xtract_harmonic_spectrum()). + * \param N: the number of elements to be considered + * \param *argv: a pointer to NULL + * \param *result: the centroid of the values pointed to by *data + * + * Note: for a more 'accurate' result *result from xtract_peak_spectrum() can be passed in. This gives the interpolated peak frequency locations. + * + */ +int xtract_spectral_centroid(const double *data, const int N, const void *argv, double *result); + +/** \brief Calculate the Irregularity of an input vector using a method described by Krimphoff (1994) + * + * \param *data: a pointer to the first element in an array of doubles representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum(). + * \param N: the number of elements to be considered + * \param *argv: a pointer to NULL + * \param *result: the irregularity of N values from the array pointed to by *data + */ +int xtract_irregularity_k(const double *data, const int N, const void *argv, double *result); + +/** \brief Calculate the Irregularity of an input vector using a method described by Jensen (1999) + * + * \param *data: a pointer to the first element in an array of doubles representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum(). + * \param N: the number of elements to be considered + * \param *argv: a pointer to NULL + * \param *result: the irregularity of N values from the array pointed to by *data + */ +int xtract_irregularity_j(const double *data, const int N, const void *argv, double *result); + +/** \brief Calculate the Tristimulus of an input vector using a method described by Pollard and Jansson (1982) + * + * \param *data: a pointer to the first element in an array of doubles representing a harmonic spectrum of size N/2, and a frequency spectrum of size N/2 (This is the output format of xtract_harmonic_spectrum()) + * \param N: the number of elements to be considered + * \param *argv: a pointer to a double representing the fundamental frequency of the input vector. + * \param *result: the tristimulus of N values from the array pointed to by *data + * + * These three functions provide the first, second and third order tristimulus formulae + * + */ +int xtract_tristimulus_1(const double *data, const int N, const void *argv, double *result); +int xtract_tristimulus_2(const double *data, const int N, const void *argv, double *result); +int xtract_tristimulus_3(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the smoothness of an input vector using a method described by McAdams (1999) + * + * \param *data: a pointer to the first element in an array of doubles representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum(). + * \param N: the number of elements to be considered + * \param *argv: a pointer to NULL + * \param *result: the smoothness of N values from the array pointed to by *data + */ +int xtract_smoothness(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the spectral spread of an input vector using a method described by Casagrande(2005) + * + * \param *data: a pointer to the first element in an array of doubles representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum(). + * \param N: the number of elements to be considered + * \param *argv: a pointer to a double corresponding to the spectral centroid + * \param *result: the spectral spread of N values from the array pointed to by *data + */ +int xtract_spread(const double *data, const int N, const void *argv, double *result); + +/* Zero crossing rate */ + +/** \brief Extract the zero crossing rate of an input vector + * + * \param *data: a pointer to the first element in an array of doubles + * \param N: the number of elements to be considered + * \param *argv: a pointer to NULL + * \param *result: the zero crossing rate of N values from the array pointed to by *data + */ +int xtract_zcr(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the spectral rolloff of an input vector using a method described by Bee Suan Ong (2005) + * + * \param *data: a pointer to the first element in an array of doubles representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum(). + * \param N: the number of elements to be considered + * \param *argv: a pointer to an array containing a double representing (samplerate / N ) and a double representing the threshold for rolloff, i.e. the percentile at which the rolloff is determined, expressed as a percentage, and + * \param *result: the spectral rolloff in Hz of N values from the array pointed to by *data. This is the point in the spectrum below which argv[0] of the energy is distributed. + */ +int xtract_rolloff(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the 'total loudness' of an input vector using a method described by Moore, Glasberg et al (2005) + * + * \param *data: a pointer to the first element in an array of doubles representing a set of BARK_BANDS bark coefficients + * \param N: the number of coefficients to be considered + * \param *argv: a pointer to NULL + * \param *result: the total loudness of N values from the array pointed to by *data + * + * Note: if N = 1, the 'specific loudness' of the bark band pointed to by *data will be given by *result + * + */ +int xtract_loudness(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the spectral flatness measure of an input vector, where the flatness measure (SFM) is defined as the ratio of the geometric mean to the arithmetic mean of a magnitude spectrum. + * + * \note The computation method used here is the most efficient by a significant margin, but suffers from precision problems due to the multiplication operationin the geometric mean calculation. This is particularly accute for larger values of N (>=256). However, as noted by Peeters (2003), the SFM should generally be computed on a small number of 'bands' rather than on the complete magnitude spectrum. It is therefore highly recommended that xtract_bands() is used prior to calling xtract_flatness(). + * + * \param *data: a pointer to the first element in an array of doubles representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum(). Alternatively the magnitudes from a number of 'subbands' can be used by using *result from xtract_bands(). + * \param N: the number of *data array elements to be considered + * \param *argv: a pointer to NULL + * \param *result: the flatness of N values from the array pointed to by *data + */ +int xtract_flatness(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the LOG spectral flatness measure of an input vector + * + * \param *data: a pointer to NULL. + * \param N: not used - can safely be set to 0. + * \param *argv: a pointer to a double represnting spectral flatness. + * \param *result: the LOG spectral flatness of N values from the array pointed to by *data + * + * flatness_db = 10 * log10(flatness) + * + */ +int xtract_flatness_db(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the tonality factor of an input vector using a method described by Peeters 2003 + * + * \param *data: a pointer to NULL. + * \param N: not used - can safely be set to 0. + * \param *argv: a pointer to the LOG spectral flatness measure of an audio vector (e.g. the output from xtract_flatness_db) + * \param *result: the tonality factor of N values from the array pointed to by *data + */ +int xtract_tonality(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the noisiness of an input vector using a method described by Tae Hong Park (2000) + * + * \param *data: a pointer to NULL + * \param N: + * \param *argv: a pointer to an array containing a double represnting the number of harmonic partials in a spectrum, and a double representing the number of partials in a spectrum + * \param *result: the noisiness coefficient as calculated from argv + */ +int xtract_noisiness(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the RMS amplitude of an input vector using a method described by Tae Hong Park (2000) + * + * \param *data: a pointer to the first element in an array of doubles + * \param N: the number of elements to be considered + * \param *argv: a pointer to NULL + * \param *result: the RMS amplitude of N values from the array pointed to by *data + */ +int xtract_rms_amplitude(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the Inharmonicity of an input vector + * + * \param *data: a pointer to the first element in an array of doubles represeting a magnitude peak spectrum of size N/2, and a frequency spectrum of size N/2 (This is the output format of xtract_peak_spectrum()) + * \param N: the number of elements to be considered + * \param *argv: a pointer to a double representing the fundamental frequency of the input vector. + * \param *result: the inharmonicity of N values from the array pointed to by *data + */ +int xtract_spectral_inharmonicity(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the spectral crest of an input vector using a method described by Peeters (2003) + * + * \param *data: a pointer to NULL + * \param N: not used + * \param *argv: a pointer to an array containing a double representing the maximum value in a spectrum, and a double representing the mean value of a spectrum + * \param *result: the spectral crest of N values from the array pointed to by *data + */ +int xtract_crest(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the Spectral Power of an input vector using a method described by Bee Suan Ong (2005) + * + * \param *data: a pointer to the first element in an array of doubles representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum(). + * \param N: the number of elements to be considered + * \param *argv: a pointer to NULL + * \param *result: the spectral power of N values from the array pointed to by *data + */ +int xtract_power(const double *data, const int N, const void *argv, double *result); + +/* Odd to even harmonic ratio */ +/** \brief Extract the Odd to even harmonic ratio of an input vector + * + * \param *data: a pointer to the first element in an array of doubles representing a harmonic spectrum of size N/2, and a frequency spectrum of size N/2 (This is the output format of xtract_harmonic_spectrum()) + * \param N: the number of elements to be considered. + * \param *argv: a pointer to a double representing the fundamental frequency of the input vector. + * \param *result: the even/odd harmonic ratio of N values from the array pointed to by *data + */ +int xtract_odd_even_ratio(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the Sharpness of an input vector + * + * \param *data: a pointer to the first element in an array of doubles representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum(). + * \param N: the number of elements to be considered + * \param *argv: a pointer to NULL + * \param *result: the Sharpness of N values from the array pointed to by *data + */ +int xtract_sharpness(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the Slope of an input vector using a method described by Peeters(2003) + * + * \param *data: a pointer to the first element in an array of doubles representing the spectrum of an audio vector, (e.g. the array pointed to by *result from xtract_spectrum(), xtract_peak_spectrum() or xtract_harmonic_spectrum()). + * \param N: the number of elements to be considered + * \param *argv: a pointer to NULL + * \param *result: the Slope of N values from the array pointed to by *data + */ +int xtract_spectral_slope(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the value of the lowest value in an input vector + * + * \param *data: a pointer to the first element in an array of doubles + * \param N: the number of elements to be considered + * \param *argv: a pointer to a double representing the lower limit for the search. All values in the array pointed to by *data that are below or equal to this threshold will be ignored. + * \param *result: a pointer to a value representing the lowest component in *data that falls above a given threshold. + * + * \return XTRACT_SUCCESS is a lowest value was found or XTRACT_NO_VALUE if all values + * in the array pointed to by *data are below or equal to the threshold set with *argv + * + * \note If XTRACT_NO_VALUE is returned, *result will be set to DBL_MAX + * + */ +int xtract_lowest_value(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the value of the highest value in an input vector + * + * \param *data: a pointer to the first element in an array of doubles + * \param N: the number of elements to be considered + * \param *argv: a pointer to NULL. + * \param *result: a pointer to a value representing the highest component in *data. + * + */ +int xtract_highest_value(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the sum of the values in an input vector + * + * \param *data: a pointer to the first element in an array of doubles + * \param N: the number of elements to be considered + * \param *argv: a pointer to NULL. + * \param *result: a pointer to a value representing the sum of all of the values pointed to by *data. + * + */ +int xtract_sum(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the Pitch of an input vector using Harmonic Product Spectrum (HPS) analysis + * + * \param *data: a pointer to the first element in an array of doubles representing the spectrum of an audio vector (e.g. *result from xtract_spectrum). It is expected that the first half of the array pointed to by *data will contain amplitudes for each frequecy bin, and the second half will contain the respective frequencies + * \param N: The length of the vector pointed to by *data. + * \param *argv: a pointer to NULL + * \param *result: the pitch of N values from the array pointed to by *data + */ +int xtract_hps(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the fundamental frequency of an input vector + * + * \param *data: a pointer to the first element in an array of doubles representing an audio vector + * \param N: the number of elements to be considered + * \param *argv: a pointer to a double representing the audio sample rate + * \param *result: the pitch of N values from the array pointed to by *data + * + * This algorithm is based on the AMDF, with peak and centre clipping. It would benefit from further improvements to improve noise robustness and overall efficiency + * + * It is based on suggestion by Robert Bristow-Johnson in a discussion on the comp.dsp mailing list, subject "Reference implementation of pitch detection" + * + */ +int xtract_f0(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the fundamental frequency of an input vector + * + * \param *data: a pointer to the first element in an array of doubles representing an audio vector + * \param N: the number of elements to be considered + * \param *argv: a pointer to a double representing the audio sample rate + * \param *result: the pitch of N values from the array pointed to by *data + * + * This function wraps xtract_f0, but provides the frequency of the lowest partial in the peak spectrum if f0 can't be found. + * + */ +int xtract_failsafe_f0(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the fundamental frequency of an input vector using wavelet-based method + * + * \param *data: a pointer to the first element in an array of doubles representing an audio vector + * \param N: the number of elements to be considered + * \param *argv: a pointer to a double representing the audio sample rate + * \param *result: the pitch of N values from the array pointed to by *data + * + * This function uses the time-domain wavelet-based method described in Larson and Maddox (2005) and + * implemented in the dywapitchtrack library + * + * xtract_init_wavelet_f0_state() must be called exactly once prior to calling xtract_wavelet_f0() + * + */ +int xtract_wavelet_f0(const double *data, const int N, const void *argv, double *result); + + +/** \brief Convenience function to convert a frequency in Hertz to a "pitch" value in MIDI cents + * + * \param *data: not used + * \param N: not used + * \param *argv: a pointer to a double-precision floating point value representing a frequency in Hertz + * \param *result: a pointer to a double-precision floating point value representing a "pitch" in MIDI cents + * \return if *argv value causes a *result within the range 0..127, XTRACT_SUCCESS will be returned, otherwise XTRACT_ARGUMENT_ERROR + * + */ +int xtract_midicent(const double *data, const int N, const void *argv, double *result); + + +/** \brief Extract the number of non-zero elements in an input vector + * + * \param *data: a pointer to the first element in an array of doubles + * \param N: the number of elements to be considered + * \param *argv: not used + * \param *result: the number of non-zero elements in the array pointed to by *data + * + */ +int xtract_nonzero_count(const double *data, const int N, const void *argv, double *result); + +/** + * \brief Return XTRACT_SUCCESS if the 'current' value is considered a peak + * + * @param data a pointer to an array containing time series as provided by *result from xtract_last_n() where the Nth value is considered the 'current' value + * @param N an integer representing the number of elements in the time series + * @param argv a pointer to a double representing the threshold, whereby the current value will be considered a peak if it is above the average of the last N values (*data) by the threshold + * @param result a pointer to a copy of the current value if the current value is considered a peak + * + * + * @return XTRACT_SUCCESS if a peak was found or XTRACT_NO_RESULT if not + */ +int xtract_peak(const double *data, const int N, const void *argv, double *result); + + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif + + + diff --git a/include/xtract/xtract_stateful.h b/include/xtract/xtract_stateful.h new file mode 100644 index 0000000..6a5c900 --- /dev/null +++ b/include/xtract/xtract_stateful.h @@ -0,0 +1,66 @@ +/* + * 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. + * + */ + +/** \file xtract_stateful.h: declares functions that extract features that require stateful data to be retained between frames */ +#ifndef XTRACT_STATEFUL_H +#define XTRACT_STATEFUL_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup stateful feature extraction functions and data structures + * + * Functions that extract a feature over multiple frames + * + * @{ + */ + + +#include +#include + +typedef struct xtract_last_n_state_ xtract_last_n_state; + +xtract_last_n_state *xtract_last_n_state_new(size_t capacity); +void xtract_last_n_state_delete(xtract_last_n_state *last_n_state); + + +/** + * Write a vector of the last N input values to `result` + * + * @param state a pointer to an xtract_peak_picker_state struct as allocated by xtract_peak_picker_state_new() + * @param data a pointer to a double representing the current input value + * @param N an integer representing 'N' the number of values to be written to *result + * @param argv a pointer to NULL + * @param result a pointer to an array of doubles representing the last N values, where the nth value is the current one. The array must have been allocated to size N elements and initialised by the caller + * + */ +int xtract_last_n(const xtract_last_n_state *state, const double *data, const int N, const void *argv, double *result); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/xtract/xtract_types.h b/include/xtract/xtract_types.h new file mode 100644 index 0000000..fe75b6e --- /dev/null +++ b/include/xtract/xtract_types.h @@ -0,0 +1,48 @@ +/* + * 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. + * + */ + +/* \file xtract_types.h: declares specialised variable types used by libxtract */ + +#ifndef XTRACT_TYPES_H +#define XTRACT_TYPES_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* \brief Data structure used to store amplitude data between calls to xtract_attack_time and other functions. */ +typedef struct _xtract_amp_tracker { + int count; + double previous_amp; +} xtract_amp_tracker; + +typedef struct _xtract_frame_tracker { + int frame_count; + double *previous_frame; +} xtract_frame_tracker; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/xtract/xtract_vector.h b/include/xtract/xtract_vector.h new file mode 100644 index 0000000..f935da6 --- /dev/null +++ b/include/xtract/xtract_vector.h @@ -0,0 +1,188 @@ +/* + * 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. + * + */ + +/** \file xtract_vector.h: declares functions that extract a feature as a vector from an input vector */ + +#ifndef XTRACT_VECTOR_H +#define XTRACT_VECTOR_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup vector vector extraction functions + * + * Functions that extract a feature as a vector from an input vector + * + * @{ + */ + +/** \brief Extract frequency domain spectrum from time domain signal + * + * \param *data: a pointer to the first element in an array of doubles representing an audio vector + * \param N: the number of array elements to be considered + * \param *argv: a pointer to an array of doubles, the first representing (samplerate / N), the second will be cast to an integer and determines the spectrum type (e.g. XTRACT_MAGNITUDE_SPECTRUM, XTRACT_LOG_POWER_SPECTRUM). The third argument determines whether or not the DC component is included in the output. If argv[2] == 1, then the DC component is included in which case the size of the array pointed to by *result must be N+2. For any further use of the array pointed to by *result, the value of N must reflect the (larger) array size. The fourth argument determines whether the magnitude/power coefficients are to be normalised. If argv[3] == 1, then the coefficients are normalised. + * \param *result: a pointer to an array of size N containing N/2 magnitude/power/log magnitude/log power coefficients and N/2 bin frequencies. + * + * The magnitude/power coefficients are scaled to the range 0-1 so that for a given coefficient x, 0 <= x <= 1 + * + * \note Before calling xtract_spectrum(), the FFT must be initialised by calling xtract_init_fft(N, XTRACT_SPECTRUM) + * + */ +int xtract_spectrum(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract autocorrelation from time domain signal using FFT based method + * + * \param *data: a pointer to the first element in an array of doubles representing an audio vector + * \param N: the number of array elements to be considered + * \param *argv: a pointer to NULL + * \param *result: the autocorrelation of N values from the array pointed to by *data + */ +int xtract_autocorrelation_fft(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract Mel Frequency Cepstral Coefficients based on a method described by Rabiner + * + * \param *data: a pointer to the first element in an array of spectral magnitudes, e.g. the first half of the array pointed to by *resul from xtract_spectrum() + * \param N: the number of array elements to be considered + * \param *argv: a pointer to a data structure of type xtract_mel_filter, containing n_filters coefficient tables to make up a mel-spaced filterbank + * \param *result: a pointer to an array containing the resultant MFCC + * + * The data structure pointed to by *argv must be obtained by first calling xtract_init_mfcc + */ +int xtract_mfcc(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the Discrete Cosine transform of a time domain signal + * \param *data: a pointer to the first element in an array of doubles representing an audio vector + * \param N: the number of array elements to be considered + * \param *argv: a pointer to NULL + * \param *result: a pointer to an array containing resultant dct coefficients + */ +int xtract_dct(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract autocorrelation from time domain signal using time-domain autocorrelation technique + * + * \param *data: a pointer to the first element in an array of doubles representing an audio vector + * \param N: the number of array elements to be considered + * \param *argv: a pointer to NULL + * \param *result: the autocorrelation of N values from the array pointed to by *data + */ +int xtract_autocorrelation(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract Average Magnitude Difference Function from time domain signal + * + * \param *data: a pointer to the first element in an array of doubles representing an audio vector + * \param N: the number of array elements to be considered + * \param *argv: a pointer to NULL + * \param *result: the AMDF of N values from the array pointed to by *data + */ +int xtract_amdf(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract Average Squared Difference Function from time domain signal + * + * \param *data: a pointer to the first element in an array of doubles representing an audio vector + * \param N: the number of array elements to be considered + * \param *argv: a pointer to NULL + * \param *result: the ASDF of N values from the array pointed to by *data + */ +int xtract_asdf(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract Bark band coefficients based on a method + * \param *data: a pointer to the first element in an array of doubles representing the magnitude coefficients from the magnitude spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum(). + * \param N: the number of array elements to be considered + * \param *argv: a pointer to an array of ints representing the limits of each bark band. This can be obtained by calling xtract_init_bark. + * \param *result: a pointer to an array containing resultant bark coefficients + * + * The limits array pointed to by *argv must be obtained by first calling xtract_init_bark + * + */ +int xtract_bark_coefficients(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the amplitude and frequency of spectral peaks from a magnitude spectrum + * \param *data: a pointer to an array of size N containing N magnitude/power/log magnitude/log power coefficients. (e.g. the first half of the array pointed to by *result from xtract_spectrum(). + * \param N: the size of the input array (note: it is assumed that enough memory has been allocated for an output array twice the size) + * \param *argv: a pointer to an array of doubles, the first representing (samplerate / N), the second representing the peak threshold as percentage of the magnitude of the maximum peak found + * \param *result: a pointer to an array of size N * 2 containing N magnitude/power/log magnitude/log power coefficients and N bin frequencies. + * + */ +int xtract_peak_spectrum(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract the harmonic spectrum of from a of a peak spectrum + * \param *data: a pointer to the first element in an array of doubles representing the peak spectrum of an audio vector (e.g. *result from xtract_peaks). It is expected that the first half of the array pointed to by *data will contain amplitudes for each peak considered, and the the second half will contain the respective frequencies + * \param N: the size of the array pointed to by *data + * \param *argv: a pointer to an array containing the fundamental (f0) of the spectrum, and a threshold (t) where 0<=t<=1.0, and t determines the distance from the nearest harmonic number within which a partial can be considered harmonic. + * \param *result: a pointer to an array of size N containing N/2 magnitude coefficients and N/2 bin frequencies. + */ +int xtract_harmonic_spectrum(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract Linear Predictive Coding Coefficients + * + * Based on algorithm in Rabiner and Juang as implemented by Jutta Degener in Dr. Dobb's Journal December, 1994. + * + * Returns N-1 reflection (PARCOR) coefficients and N-1 LPC coefficients via *result + * + * \param *data: N autocorrelation values e.g the data pointed to by *result from xtract_autocorrelation() + * \param N: the number of autocorrelation values to be considered + * \param *argv: a pointer to NULL + * \param *result: a pointer to an array containing N-1 reflection coefficients and N-1 LPC coefficients. + * + * An array of size 2 * (N - 1) must be allocated, and *result must point to its first element. + */ +int xtract_lpc(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract Linear Predictive Coding Cepstral Coefficients + * + * \param *data: a pointer to the first element in an array of LPC coeffiecients e.g. a pointer to the second half of the array pointed to by *result from xtract_lpc() + * \param N: the number of LPC coefficients to be considered + * \param *argv: a pointer to a double representing the order of the result vector. This must be a whole number. According to Rabiner and Juang the ratio between the number (p) of LPC coefficients and the order (Q) of the LPC cepstrum is given by Q ~ (3/2)p where Q > p. + * \param *result: a pointer to an array containing the resultant LPCC. + * + * An array of size Q, where Q is given by argv[0] must be allocated, and *result must point to its first element. + * + */ +int xtract_lpcc(const double *data, const int N, const void *argv, double *result); + +/** \brief Extract subbands from a spectrum + * + * \param *data: a pointer to an array of size N containing N magnitude/power/log magnitude/log power coefficients. (e.g. the first half of the array pointed to by *result from xtract_spectrum(). + * \param N: the number of elements from the array pointed to by *data to be considered + * \param *argv: A pointer to an array containing four integers. The first represents the extraction function to applied to each subband e.g. XTRACT_SUM or XTRACT_MEAN, the second represents the number of subbands required, and the third represents the frequency scale to be used for the subband bounds as defined in the enumeration xtract_subband_scales_ (libxtract.h). The fourth integer represent the start point of the subbands as a location in the input array as pointed to by *data (e.g. a value of 5 would start the subband extraction at bin 5) + * \param *result: A pointer to an array containing the resultant subband values. The calling function is responsible for allocating and freeing memory for *result. xtract_subbands() assumes that at least argv[1] * sizeof(double) bytes have been allocated. If the requested nbands extends the subband range beyond N, then the remaining bands will be set to 0. If the array pointed to by *result has more than argv[1] elements, the superfluous elements will be unchanged. + * + * xtract_subbands() divides a spectrum into subbands and applies the function given by argv[0] to the values in each subband to give a 'reduced' representation of the spectrum as *result + * + * Specifying XTRACT_OCTAVE_SUBBANDS will extract subbands at each octave from the start bin until argv[1] is reached or N is reached + * Specifying XTRACT_LINEAR_SUBBANDS will extract argv[1] equal sized subbands between the start bin and N + * + * + * It is assumed that a sensible function will be given in argv[0], and for this function argv will always be NULL. Sensible values for argv[0] are XTRACT_MEAN and XTRACT_SUM, although something like XTRACT_IRREGULARITY_K might yield interesting results. + * + */ +int xtract_subbands(const double *data, const int N, const void *argv, double *result); +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/xtract/libxtract.h b/xtract/libxtract.h deleted file mode 100644 index 17540c5..0000000 --- a/xtract/libxtract.h +++ /dev/null @@ -1,440 +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. - * - */ - -/** \mainpage - * - * LibXtract is a simple, portable, lightweight library of audio feature extraction functions. The purpose of the library is to provide a relatively exhaustive set of feature extraction primatives that are designed to be 'cascaded' to create a extraction hierarchies. - * For example, 'variance', 'average deviation', 'skewness' and 'kurtosis', all require the 'mean' of the input vector to be precomputed. However, rather than compute the 'mean' 'inside' each function, it is expected that the 'mean' will be passed in as an argument. This means that if the user wishes to use all of these features, the mean is calculated only once, and then passed to any functions that require it. - * - * This philosophy of 'cascading' features is followed throughout the library, for example with features that operate on the magnitude spectrum of a signal vector (e.g. 'irregularity'), the magnitude spectrum is not calculated 'inside' the respective function, instead, a pointer to the first element in an array containing the magnitude spectrum is passed in as an argument. - * - * Hopefully this not only makes the library more efficient when computing large numbers of features, but also makes it more flexible because extraction functions can be combined arbitrarily (one can take the irregularility of the Mel Frequency Cepstral Coefficients for example). - * - * All feature extraction functions follow the same prototype: - * - * **int xtract_function_name(const double *data, const int N, const void *argv, double *result);** - * - * \param const double *data points to an array of doubles representing the input data - * \param const int N represents the number of elementes from *data to be considered in the calculation - * \param const void *argv represents an arbitrary list of arguments. Used to pass in values required by the feature calculation - * \param double *result points to an array of doubles, or a single double represnting the result of the calculation - * - * - * It is up to the calling function to allocate enough memory for the *data, *argv, and *result, and to free it when required. Some feature extraction functions may also require an _init() function to be called in order to perform some initialisation. The struct xtract_function_descriptor_t is used to give an indication of recommended default values, and argc for the *argv array. - * - * LibXtract can be downloaded from http://www.sf.net/projects/libxtract - * - */ - -#ifndef XTRACT_H -#define XTRACT_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \file libxtract.h - * \brief main header file and API definition - */ - -#include "xtract_scalar.h" -#include "xtract_vector.h" -#include "xtract_delta.h" -#include "xtract_types.h" -#include "xtract_macros.h" -#include "xtract_helper.h" - -/** \defgroup libxtract API - * - * Defines a very simple API that provides access to the functions in the library - * @{ - */ - -#define XTRACT_FEATURES 62 - -/** \brief Enumeration of features, elements are used as indixes to an array of pointers to feature extracton functions */ -enum xtract_features_ { - XTRACT_MEAN, - XTRACT_VARIANCE, - XTRACT_STANDARD_DEVIATION, - XTRACT_AVERAGE_DEVIATION, - XTRACT_SKEWNESS, - XTRACT_KURTOSIS, - XTRACT_SPECTRAL_MEAN, - XTRACT_SPECTRAL_VARIANCE, - XTRACT_SPECTRAL_STANDARD_DEVIATION, - /*XTRACT_SPECTRAL_AVERAGE_DEVIATION, */ - XTRACT_SPECTRAL_SKEWNESS, - XTRACT_SPECTRAL_KURTOSIS, - XTRACT_SPECTRAL_CENTROID, - XTRACT_IRREGULARITY_K, - XTRACT_IRREGULARITY_J, - XTRACT_TRISTIMULUS_1, - XTRACT_TRISTIMULUS_2, - XTRACT_TRISTIMULUS_3, - XTRACT_SMOOTHNESS, - XTRACT_SPREAD, - XTRACT_ZCR, - XTRACT_ROLLOFF, - XTRACT_LOUDNESS, - XTRACT_FLATNESS, - XTRACT_FLATNESS_DB, - XTRACT_TONALITY, - XTRACT_CREST, - XTRACT_NOISINESS, - XTRACT_RMS_AMPLITUDE, - XTRACT_SPECTRAL_INHARMONICITY, - XTRACT_POWER, - XTRACT_ODD_EVEN_RATIO, - XTRACT_SHARPNESS, - XTRACT_SPECTRAL_SLOPE, - XTRACT_LOWEST_VALUE, - XTRACT_HIGHEST_VALUE, - XTRACT_SUM, - XTRACT_NONZERO_COUNT, - XTRACT_HPS, - XTRACT_F0, - XTRACT_FAILSAFE_F0, - XTRACT_WAVELET_F0, - XTRACT_MIDICENT, - XTRACT_LNORM, - XTRACT_FLUX, - XTRACT_ATTACK_TIME, - XTRACT_DECAY_TIME, - XTRACT_DIFFERENCE_VECTOR, - XTRACT_AUTOCORRELATION, - XTRACT_AMDF, - XTRACT_ASDF, - XTRACT_BARK_COEFFICIENTS, - XTRACT_PEAK_SPECTRUM, - XTRACT_SPECTRUM, - XTRACT_AUTOCORRELATION_FFT, - XTRACT_MFCC, - XTRACT_DCT, - XTRACT_HARMONIC_SPECTRUM, - XTRACT_LPC, - XTRACT_LPCC, - XTRACT_SUBBANDS, - /* Helper functions */ - XTRACT_WINDOWED, - XTRACT_SMOOTHED -}; - -/** \brief Enumeration of feature initialisation functions */ -enum xtract_feature_init_ { - XTRACT_INIT_MFCC = 100, - XTRACT_INIT_BARK, - XTRACT_INIT_WINDOWED -}; - -/** \brief Enumeration of feature types */ -enum xtract_feature_types_ { - XTRACT_SCALAR, - XTRACT_VECTOR, - XTRACT_DELTA -}; - -/** \brief Enumeration of mfcc types */ -enum xtract_mfcc_types_ { - XTRACT_EQUAL_GAIN, - XTRACT_EQUAL_AREA -}; - -enum xtract_lnorm_filter_types_ { - XTRACT_NO_LNORM_FILTER, - XTRACT_POSITIVE_SLOPE, - XTRACT_NEGATIVE_SLOPE -}; - -/** \brief Enumeration of return codes */ -enum xtract_return_codes_ { - XTRACT_SUCCESS, - XTRACT_MALLOC_FAILED, - XTRACT_BAD_ARGV, - XTRACT_BAD_VECTOR_SIZE, - XTRACT_BAD_STATE, - XTRACT_DENORMAL_FOUND, - XTRACT_NO_RESULT, /* This usually occurs when the correct calculation cannot take place because required data is missing or would result in a NaN or infinity/-infinity. Under these curcumstances 0.f is usually given by *result */ - XTRACT_FEATURE_NOT_IMPLEMENTED, - XTRACT_ARGUMENT_ERROR -}; - -/** \brief Enumeration of spectrum types */ -enum xtract_spectrum_ { - XTRACT_MAGNITUDE_SPECTRUM, - XTRACT_LOG_MAGNITUDE_SPECTRUM, - XTRACT_POWER_SPECTRUM, - XTRACT_LOG_POWER_SPECTRUM -}; - -/** \brief Subband scales */ -enum xtract_subband_scales_ { - XTRACT_OCTAVE_SUBBANDS, - XTRACT_LINEAR_SUBBANDS -}; - -/** \brief Enumeration of data types*/ -typedef enum type_ { - XTRACT_FLOAT, - XTRACT_FLOATARRAY, - XTRACT_INT, - XTRACT_MEL_FILTER -} xtract_type_t; - -/** \brief Enumeration of units*/ -typedef enum unit_ { - /* NONE, ANY */ - XTRACT_HERTZ = 2, - XTRACT_ANY_AMPLITUDE_HERTZ, - XTRACT_DBFS, - XTRACT_DBFS_HERTZ, - XTRACT_PERCENT, - XTRACT_BINS, - XTRACT_SONE, - XTRACT_MIDI_CENT -} xtract_unit_t; - -/** \brief Boolean */ -typedef enum { - XTRACT_FALSE, - XTRACT_TRUE -} xtract_bool_t; - -/** \brief Window types */ -enum xtract_window_types_ { - XTRACT_GAUSS, - XTRACT_HAMMING, - XTRACT_HANN, - XTRACT_BARTLETT, - XTRACT_TRIANGULAR, - XTRACT_BARTLETT_HANN, - XTRACT_BLACKMAN, - XTRACT_KAISER, - XTRACT_BLACKMAN_HARRIS -}; - -/** \brief Enumeration of vector format types*/ -typedef enum xtract_vector_ { - /* N/2 magnitude/log-magnitude/power/log-power coeffs and N/2 frequencies */ - XTRACT_SPECTRAL, - /* N spectral amplitudes */ - XTRACT_SPECTRAL_MAGNITUDES, - /* N/2 magnitude/log-magnitude/power/log-power peak coeffs and N/2 - * frequencies */ - XTRACT_SPECTRAL_PEAKS, - /* N spectral peak amplitudes */ - XTRACT_SPECTRAL_PEAKS_MAGNITUDES, - /* N spectral peak frequencies */ - XTRACT_SPECTRAL_PEAKS_FREQUENCIES, - /* N/2 magnitude/log-magnitude/power/log-power harmonic peak coeffs and N/2 - * frequencies */ - XTRACT_SPECTRAL_HARMONICS, - /* N spectral harmonic amplitudes */ - XTRACT_SPECTRAL_HARMONICS_MAGNITUDES, - /* N spectral harmonic frequencies */ - XTRACT_SPECTRAL_HARMONICS_FREQUENCIES, - XTRACT_AUTOCORRELATION_COEFFS, - XTRACT_ARBITRARY_SERIES, - XTRACT_AUDIO_SAMPLES, - XTRACT_MEL_COEFFS, - XTRACT_LPC_COEFFS, - XTRACT_LPCC_COEFFS, - XTRACT_BARK_COEFFS, - XTRACT_SUBFRAMES, - XTRACT_NO_DATA -} xtract_vector_t; - -/** \brief Data structure containing useful information about functions provided by LibXtract. */ -typedef struct _xtract_function_descriptor { - - int id; - - struct { - char name[XTRACT_MAX_NAME_LENGTH]; - char p_name[XTRACT_MAX_NAME_LENGTH]; /* pretty name */ - char desc[XTRACT_MAX_DESC_LENGTH]; - char p_desc[XTRACT_MAX_DESC_LENGTH]; /* pretty description */ - char author[XTRACT_MAX_AUTHOR_LENGTH]; - int year; - } algo; - - struct { - xtract_vector_t format; - xtract_unit_t unit; - } data; - - int argc; - - struct { - xtract_type_t type; /* type of the array/value pointed to by argv */ - double min[XTRACT_MAXARGS]; - double max[XTRACT_MAXARGS]; - double def[XTRACT_MAXARGS]; /* defaults */ - xtract_unit_t unit[XTRACT_MAXARGS]; - int donor[XTRACT_MAXARGS]; /* suggested donor functions for argv */ - } argv; - - xtract_bool_t is_scalar; - xtract_bool_t is_delta; /* features in xtract_delta.h can be scalar or vector */ - - /* The result.<> entries in descritors.c need to be checked */ - union { - - struct { - double min; - double max; - xtract_unit_t unit; - } scalar; - - struct { - xtract_vector_t format; - xtract_unit_t unit; - } vector; - - } result; - -} xtract_function_descriptor_t; - -/** - * - * \brief An array of pointers to functions that perform the extraction - * - * \param *data: a pointer to the start of the input data (usually the first element in an array) - * - * \param N: the number of elements to be processed - * - * \param *argv: an abitrary number of additional arguments, used to pass additional parameters to the function being called. All arguments are compulsary! - * - * \param *result: a pointer to the first element in the result - * - * Each function will iterate over N array elements, the first of which is - * pointed to by *data. It is up to the calling function to ensure that the array is in the format expected by the function being called. - * - * For scalar and delta features, *result will point to a single value. - * - * For vector features it will point to the first element in an array. - * - * Memory for this array must be allocated and freed by the calling - * function. - * - * All functions return an integer error code as descibed in the enumeration - * return_codes_ - * - * The preprocessor macro: XTRACT must be defined before this can be used - * - * example:
- * \verbatim -#include -#define XTRACT -#include "libxtract.h" - -main () { -double values[] = {1.0, 2.0, 3.0, 4.0, 5.0}; -int N = 5; -double mean; - -xtract[MEAN]((void *)values, N, NULL, &mean); - -printf("Mean = %.2f\n", mean); -} -\endverbatim - * The calling function may additionally make some tests against the value returned by xtract - * - */ -#ifdef XTRACT_H -extern int(*xtract[XTRACT_FEATURES])(const double *data, const int N, const void *argv, double *result); - -#endif - -/** \brief A function to initialise wavelet f0 detector state */ -int xtract_init_wavelet_f0_state(void); - -/** \brief A structure to store a set of n_filters Mel filters */ -typedef struct xtract_mel_filter_ { - int n_filters; - double **filters; -} xtract_mel_filter; - -/** \brief A function to initialise a mel filter bank - * - * It is up to the caller to pass in a pointer to memory allocated for freq_bands arrays of length N. This function populates these arrays with magnitude coefficients representing the mel filterbank on a linear scale - */ -int xtract_init_mfcc(int N, double nyquist, int style, double freq_min, double freq_max, int freq_bands, double **fft_tables); - -/** \brief A function to initialise bark filter bounds - * - * A pointer to an array of BARK_BANDS ints most be passed in, and is populated with BARK_BANDS fft bin numbers representing the limits of each band - * - * \param N: the audio block size - * \param sr: The sample audio sample rate - * \param *band_limits: a pointer to an array of BARK_BANDS ints - */ -int xtract_init_bark(int N, double sr, int *band_limits); - -/** \brief An initialisation function for functions using FFT - * - * This function initialises global data structures used by functions requiring FFT functionality. It can be called multiple times with different feature names. Calling it more than once with the same feature name is not a valid operation and will result in a memory leak. - * - * \param N: the size of the FFT - * \param feature_name: the name of the feature the FFT is being used for, - * e.g. XTRACT_DCT - * - */ -int xtract_init_fft(int N, int feature_name); - -/** \brief Free memory used for fft plans - * - * This function should be used to explicitly free memory allocated for ffts by xtract_init_fft(). It is primarily intended for use if a new FFT needs to be taken with a different blocksize. If only one fft size is required then there is no need to call this function since it will be called when the program exits. - * */ -void xtract_free_fft(void); - -/** \brief Make a window of a given type and return a pointer to it - * - * \param N: the size of the window - * \param type: the type of the window as given in the enumeration window_types_ - * - */ -double *xtract_init_window(const int N, const int type); - -/** \brief Free a window as allocated by xtract_make_window() - * - * \param *window: a pointer to an array of doubles as allocated by xtract_make_window() - * - */ -void xtract_free_window(double *window); - -/* \brief A function to build an array of function descriptors */ -xtract_function_descriptor_t *xtract_make_descriptors(); - -/* \brief A function to free an array of function descriptors */ -int xtract_free_descriptors(xtract_function_descriptor_t *fd); -/* Free functions */ - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/xtract/xtract_delta.h b/xtract/xtract_delta.h deleted file mode 100644 index c7b3ee7..0000000 --- a/xtract/xtract_delta.h +++ /dev/null @@ -1,88 +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. - * - */ - -/** \file xtract_delta.h: declares functions that scalar or vector value from 2 or more input vectors */ - -#ifndef XTRACT_DELTA_H -#define XTRACT_DELTA_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \defgroup delta `delta' extraction functions - * - * Functions that extract a scalar or vector value from 2 or more input vectors - * - * @{ - */ - -#include "xtract_types.h" - -/** \brief Extract flux - * - * \note FIX: don't be lazy -- take the lnorm of the difference vector! - * An alias for xtract_lnorm() - */ -int xtract_flux(const double *data, const int N, const void *argv , double *result); - -/** \brief Extract the L-norm of a vector - * - * \param *data: a pointer to the first element in an array of doubles representing the difference between two subsequent frames of output from a vector-based feature e.g. the *result from xtract_difference_vector() - * \param N: the length of the array pointed to by *data - * \param *argv: a pointer to an array of doubles, the first representing the "norm order". The second argument represents the filter type determining what values we consider from the difference vector as given in the enumeration xtract_lnorm_filter_types_ (libxtract.h), the third sets whether we want the result to be normalised in the range 0-1 (0 = no normalise, 1 = normalise) - * \param *result: a pointer to a double representing the flux - * - */ -int xtract_lnorm(const double *data, const int N, const void *argv , double *result); -/*xtract_frame_tracker *xf */ - -/** \brief Extract attack Time */ -int xtract_attack_time(const double *data, const int N, const void *argv , double *result); -/* xtract_amp_tracker *xa */ - -/** Extract temporal decrease */ -int xtract_decay_time(const double *data, const int N, const void *argv, double *result); -/* xtract_amp_tracker *xa */ - - -/** \brief Extract the difference between two vectors - * - * \param *data a pointer to an array representing two distinct vectors, e.g. two successive magnitude spectra. - * \param N the size of the array pointed to by *data - * \param *argv a pointer to NULL - * \param *result a pointer to an array of size N / 2 representing the difference between the two input vectors. - * - * */ -int xtract_difference_vector(const double *data, const int N, const void *argv, double *result); -/*xtract_frame_tracker *xf */ -/*double frames*/ - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/xtract/xtract_helper.h b/xtract/xtract_helper.h deleted file mode 100644 index 7296f0e..0000000 --- a/xtract/xtract_helper.h +++ /dev/null @@ -1,109 +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. - * - */ - -/** \file xtract_helper.h: helper functions for making life with libxtract a bit more bearable */ - -#ifndef XTRACT_HELPER_H -#define XTRACT_HELPER_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef _MSC_VER - #ifndef __cplusplus - typedef int bool; - #define false 0 - #define true 1 - #endif -#else - #include -#endif - - -/** - * \defgroup helper helper functions - * - * Declares helper functions, and their parameters. - * - * \note These functions don't necessarily conform to the prototype used in xtract_scalar.h and xtract_vector.h etc, and as such are intended to be called 'directly' rather than via the xtract[] function pointer array (libxtract.h) - * - * @{ - */ - -/** \brief Apply a window function to an array of length N - * - * \param *data a pointer to an array of doubles - * \param N the number of elements in the array pointed to by *data - * \param *argv a pointer to a window function as returned by xtract_make_window() - * \param *result a pointer to the first element an array containing the windowed data - * - * It is up to the caller to generate and free the array containing the window, and to allocate and free memory of size N to hold the data pointed to by *result - * - */ -int xtract_windowed(const double *data, const int N, const void *argv, double *result); - -/** \brief Divides the array pointed to by *data into two subframes, and applies a given feature to each subframe, returning them in a single array pointed to by result - * - * \param *data an array of doubles - * \param N the number of elements in the array pointed by *data - * \param feature an integer representing the feature to be applied to each subframe in data. This will be a value as given in the enumeration xtract_features_ (libxtract.h) - * \param *argv a pointer to the argument vector to be passed to the feature extraction function as determined by feature - * \param *result a pointer to the 'packed' results of the feature calculation. This may be passed in as *data to xtract_features_from_subframes() to calculate further features on the subframes, or xtract_difference_vector(), to get the difference between the subframes. - * - * - * It is important to ensure that any _init_*() functions that are called in preparation for functions that are called on subframes are given the subframe size as 'N', and not the frame size. i.e. if xtract_features_from_subframes() is called with N=64, and feature=XTRACT_SPECTRUM, then xtract_init_fft() should be called with N=32. - * - */ -int xtract_features_from_subframes(const double *data, const int N, const int feature, const void *argv, double *result); - -/** \brief Test whether a number is denormal */ -int xtract_is_denormal(double const d); - -/** \brief Test whether a number is a power of two */ -bool xtract_is_poweroftwo(unsigned int x); - - -/** \brief Smooth a vector - * - * \param *data a pointer to an array of doubles - * \param N the number of elements in the array pointed to by *data to be smoothed - * \param *argv a pointer to a double giving the smoothing gain - * \param *result a pointer to the first element an array containing the smoothed data - * - * \note if passing in a spectrum e.g. *result from xtract_spectrum(), then N for xtract_smoothed() should be N / 2 with respect to the N for xtract_spectrum() so only amplitude components are smoothed, not frequencies! - * - */ - int xtract_smoothed(const double *data, const int N, const void *argv, double *result); - - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/xtract/xtract_macros.h b/xtract/xtract_macros.h deleted file mode 100644 index 3445866..0000000 --- a/xtract/xtract_macros.h +++ /dev/null @@ -1,47 +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. - * - */ - -/** \file xtract_macros.h: defines useful public macros */ - -#ifndef XTRACT_MACROS_H -#define XTRACT_MACROS_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define XTRACT_BARK_BANDS 26 -#define XTRACT_WINDOW_SIZE 1024/* dummy macro for descriptors where argc is window size */ -#define XTRACT_NONE 0 -#define XTRACT_ANY -1 -#define XTRACT_UNKNOWN -2 -#define XTRACT_MAXARGS 4 -#define XTRACT_MAX_NAME_LENGTH 64 -#define XTRACT_MAX_AUTHOR_LENGTH 128 -#define XTRACT_MAX_DESC_LENGTH 256 - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/xtract/xtract_scalar.h b/xtract/xtract_scalar.h deleted file mode 100644 index 8e24284..0000000 --- a/xtract/xtract_scalar.h +++ /dev/null @@ -1,483 +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. - * - */ - -/** \file xtract_scalar.h: declares functions that extract a feature as a single value from an input vector */ - -#ifndef XTRACT_SCALAR_H -#define XTRACT_SCALAR_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \defgroup scalar scalar extraction functions - * - * Functions that extract a feature as a single value from an input vector - * - * @{ - */ - -/** \brief Extract the mean of an input vector - * - * \param *data: a pointer to the first element - * \param N: the number of array elements to be considered - * \param *argv: a pointer to NULL - * \param *result: the mean of N values from the array pointed to by *data - */ -int xtract_mean(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the variance of an input vector - * - * \param *data: a pointer to the first element in an array of doubles - * \param N: the number of elements to be considered - * \param *argv: a pointer to a double representing the mean of the input vector - * \param *result: the variance of N values from the array pointed to by *data - */ -int xtract_variance(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the deviation of an input vector - * - * \param *data: a pointer to the first element in an array of doubles - * \param N: the number of elements to be considered - * \param *argv: a pointer to a double representing the variance of the input vector - * \param *result: the deviation of N values from the array pointed to by *data - */ -int xtract_standard_deviation(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the average deviation of an input vector - * - * \param *data: a pointer to the first element in an array of doubles - * \param N: the number of elements to be considered - * \param *argv: a pointer to a double representing the mean of the input vector - * \param *result: the average deviation of N values from the array pointed to by *data - */ -int xtract_average_deviation(const double *data, const int N, const void *argv, double *result); - - -/** \brief Extract the skewness of an input vector - * - * \param *data: a pointer to the first element in an array of doubles - * \param N: the number of elements to be considered - * \param *argv: a pointer to an array of doubles representing the mean and standard deviation of the input vector - * \param *result: the skewness of N values from the array pointed to by *data - */ -int xtract_skewness(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the kurtosis of an input vector - * - * \param *data: a pointer to the first element in an array of doubles - * \param N: the number of elements to be considered - * \param *argv: a pointer to an array of values representing the mean and standard deviation of the input vector - * \param *result: the kurtosis of N values from the array pointed to by *data - */ -int xtract_kurtosis(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the mean of an input spectrum - * - * \param *data: a pointer to the first element in an array of doubles representing the spectrum of an audio vector, (e.g. the array pointed to by *result from xtract_spectrum(), xtract_peak_spectrum() or xtract_harmonic_spectrum()). - * \param N: the size of the array pointed to by *data - * \param *argv: a pointer to NULL - * \param *result: the mean of the spectrum pointed to by *data - */ -int xtract_spectral_mean(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the variance of an input spectrum - * - * \param *data: a pointer to the first element in an array of doubles representing the spectrum of an audio vector, (e.g. the array pointed to by *result from xtract_spectrum(), xtract_peak_spectrum() or xtract_harmonic_spectrum()). - * \param N: the number of elements to be considered - * \param N: the size of the array pointed to by *data - * \param *argv: a pointer to a double representing the spectral mean of the input spectrum - * \param *result: the variance of the spectrum pointed to by *data - */ -int xtract_spectral_variance(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the deviation of an input spectrum - * - * \param *data: a pointer to the first element in an array of doubles representing the spectrum of an audio vector, (e.g. the array pointed to by *result from xtract_spectrum(), xtract_peak_spectrum() or xtract_harmonic_spectrum()). - * \param N: the size of the array pointed to by *data - * \param *argv: a pointer to a double representing the spectral variance of the input spectrum - * \param *result: the deviation of the spectrum pointed to by *data - */ -int xtract_spectral_standard_deviation(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the average deviation of an input spectrum - * - * \param *data: a pointer to the first element in an array of doubles representing the spectrum of an audio vector, (e.g. the array pointed to by *result from xtract_spectrum(), xtract_peak_spectrum() or xtract_harmonic_spectrum()). - * \param N: the size of the array pointed to by *data - * \param *argv: a pointer to a double representing the spectral mean of the input spectrum - * \param *result: the average deviation of the spectrum pointed to by *data - */ -/* -int xtract_spectral_average_deviation(const double *data, const int N, const void *argv, double *result); -*/ - -/** \brief Extract the skewness of an input spectrum - * - * \param *data: a pointer to the first element in an array of doubles representing the spectrum of an audio vector, (e.g. the array pointed to by *result from xtract_spectrum(), xtract_peak_spectrum() or xtract_harmonic_spectrum()). - * \param N: the size of the array pointed to by *data - * \param *argv: a pointer to an array of doubles representing the spectral mean and spectral standard deviation of the input spectrum - * \param *result: the skewness of the spectrum pointed to by *data - */ -int xtract_spectral_skewness(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the kurtosis of an input spectrum - * - * \param *data: a pointer to the first element in an array of doubles representing the spectrum of an audio vector, (e.g. the array pointed to by *result from xtract_spectrum(), xtract_peak_spectrum() or xtract_harmonic_spectrum()). - * \param N: the size of the array pointed to by *data - * \param *argv: a pointer to an array of values representing the spectral mean and spectral standard deviation of the input spectrum - * \param *result: the kurtosis of the spectrum pointed to by *data - */ -int xtract_spectral_kurtosis(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the centroid of an input vector - * - * \param *data: a pointer to the first element in an array of doubles representing the spectrum of an audio vector, (e.g. the array pointed to by *result from xtract_spectrum(), xtract_peak_spectrum() or xtract_harmonic_spectrum()). - * \param N: the number of elements to be considered - * \param *argv: a pointer to NULL - * \param *result: the centroid of the values pointed to by *data - * - * Note: for a more 'accurate' result *result from xtract_peak_spectrum() can be passed in. This gives the interpolated peak frequency locations. - * - */ -int xtract_spectral_centroid(const double *data, const int N, const void *argv, double *result); - -/** \brief Calculate the Irregularity of an input vector using a method described by Krimphoff (1994) - * - * \param *data: a pointer to the first element in an array of doubles representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum(). - * \param N: the number of elements to be considered - * \param *argv: a pointer to NULL - * \param *result: the irregularity of N values from the array pointed to by *data - */ -int xtract_irregularity_k(const double *data, const int N, const void *argv, double *result); - -/** \brief Calculate the Irregularity of an input vector using a method described by Jensen (1999) - * - * \param *data: a pointer to the first element in an array of doubles representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum(). - * \param N: the number of elements to be considered - * \param *argv: a pointer to NULL - * \param *result: the irregularity of N values from the array pointed to by *data - */ -int xtract_irregularity_j(const double *data, const int N, const void *argv, double *result); - -/** \brief Calculate the Tristimulus of an input vector using a method described by Pollard and Jansson (1982) - * - * \param *data: a pointer to the first element in an array of doubles representing a harmonic spectrum of size N/2, and a frequency spectrum of size N/2 (This is the output format of xtract_harmonic_spectrum()) - * \param N: the number of elements to be considered - * \param *argv: a pointer to a double representing the fundamental frequency of the input vector. - * \param *result: the tristimulus of N values from the array pointed to by *data - * - * These three functions provide the first, second and third order tristimulus formulae - * - */ -int xtract_tristimulus_1(const double *data, const int N, const void *argv, double *result); -int xtract_tristimulus_2(const double *data, const int N, const void *argv, double *result); -int xtract_tristimulus_3(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the smoothness of an input vector using a method described by McAdams (1999) - * - * \param *data: a pointer to the first element in an array of doubles representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum(). - * \param N: the number of elements to be considered - * \param *argv: a pointer to NULL - * \param *result: the smoothness of N values from the array pointed to by *data - */ -int xtract_smoothness(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the spectral spread of an input vector using a method described by Casagrande(2005) - * - * \param *data: a pointer to the first element in an array of doubles representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum(). - * \param N: the number of elements to be considered - * \param *argv: a pointer to a double corresponding to the spectral centroid - * \param *result: the spectral spread of N values from the array pointed to by *data - */ -int xtract_spread(const double *data, const int N, const void *argv, double *result); - -/* Zero crossing rate */ - -/** \brief Extract the zero crossing rate of an input vector - * - * \param *data: a pointer to the first element in an array of doubles - * \param N: the number of elements to be considered - * \param *argv: a pointer to NULL - * \param *result: the zero crossing rate of N values from the array pointed to by *data - */ -int xtract_zcr(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the spectral rolloff of an input vector using a method described by Bee Suan Ong (2005) - * - * \param *data: a pointer to the first element in an array of doubles representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum(). - * \param N: the number of elements to be considered - * \param *argv: a pointer to an array containing a double representing (samplerate / N ) and a double representing the threshold for rolloff, i.e. the percentile at which the rolloff is determined, expressed as a percentage, and - * \param *result: the spectral rolloff in Hz of N values from the array pointed to by *data. This is the point in the spectrum below which argv[0] of the energy is distributed. - */ -int xtract_rolloff(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the 'total loudness' of an input vector using a method described by Moore, Glasberg et al (2005) - * - * \param *data: a pointer to the first element in an array of doubles representing a set of BARK_BANDS bark coefficients - * \param N: the number of coefficients to be considered - * \param *argv: a pointer to NULL - * \param *result: the total loudness of N values from the array pointed to by *data - * - * Note: if N = 1, the 'specific loudness' of the bark band pointed to by *data will be given by *result - * - */ -int xtract_loudness(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the spectral flatness measure of an input vector, where the flatness measure (SFM) is defined as the ratio of the geometric mean to the arithmetic mean of a magnitude spectrum. - * - * \note The computation method used here is the most efficient by a significant margin, but suffers from precision problems due to the multiplication operationin the geometric mean calculation. This is particularly accute for larger values of N (>=256). However, as noted by Peeters (2003), the SFM should generally be computed on a small number of 'bands' rather than on the complete magnitude spectrum. It is therefore highly recommended that xtract_bands() is used prior to calling xtract_flatness(). - * - * \param *data: a pointer to the first element in an array of doubles representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum(). Alternatively the magnitudes from a number of 'subbands' can be used by using *result from xtract_bands(). - * \param N: the number of *data array elements to be considered - * \param *argv: a pointer to NULL - * \param *result: the flatness of N values from the array pointed to by *data - */ -int xtract_flatness(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the LOG spectral flatness measure of an input vector - * - * \param *data: a pointer to NULL. - * \param N: not used - can safely be set to 0. - * \param *argv: a pointer to a double represnting spectral flatness. - * \param *result: the LOG spectral flatness of N values from the array pointed to by *data - * - * flatness_db = 10 * log10(flatness) - * - */ -int xtract_flatness_db(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the tonality factor of an input vector using a method described by Peeters 2003 - * - * \param *data: a pointer to NULL. - * \param N: not used - can safely be set to 0. - * \param *argv: a pointer to the LOG spectral flatness measure of an audio vector (e.g. the output from xtract_flatness_db) - * \param *result: the tonality factor of N values from the array pointed to by *data - */ -int xtract_tonality(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the noisiness of an input vector using a method described by Tae Hong Park (2000) - * - * \param *data: a pointer to NULL - * \param N: - * \param *argv: a pointer to an array containing a double represnting the number of harmonic partials in a spectrum, and a double representing the number of partials in a spectrum - * \param *result: the noisiness coefficient as calculated from argv - */ -int xtract_noisiness(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the RMS amplitude of an input vector using a method described by Tae Hong Park (2000) - * - * \param *data: a pointer to the first element in an array of doubles - * \param N: the number of elements to be considered - * \param *argv: a pointer to NULL - * \param *result: the RMS amplitude of N values from the array pointed to by *data - */ -int xtract_rms_amplitude(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the Inharmonicity of an input vector - * - * \param *data: a pointer to the first element in an array of doubles represeting a magnitude peak spectrum of size N/2, and a frequency spectrum of size N/2 (This is the output format of xtract_peak_spectrum()) - * \param N: the number of elements to be considered - * \param *argv: a pointer to a double representing the fundamental frequency of the input vector. - * \param *result: the inharmonicity of N values from the array pointed to by *data - */ -int xtract_spectral_inharmonicity(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the spectral crest of an input vector using a method described by Peeters (2003) - * - * \param *data: a pointer to NULL - * \param N: not used - * \param *argv: a pointer to an array containing a double representing the maximum value in a spectrum, and a double representing the mean value of a spectrum - * \param *result: the spectral crest of N values from the array pointed to by *data - */ -int xtract_crest(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the Spectral Power of an input vector using a method described by Bee Suan Ong (2005) - * - * \param *data: a pointer to the first element in an array of doubles representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum(). - * \param N: the number of elements to be considered - * \param *argv: a pointer to NULL - * \param *result: the spectral power of N values from the array pointed to by *data - */ -int xtract_power(const double *data, const int N, const void *argv, double *result); - -/* Odd to even harmonic ratio */ -/** \brief Extract the Odd to even harmonic ratio of an input vector - * - * \param *data: a pointer to the first element in an array of doubles representing a harmonic spectrum of size N/2, and a frequency spectrum of size N/2 (This is the output format of xtract_harmonic_spectrum()) - * \param N: the number of elements to be considered. - * \param *argv: a pointer to a double representing the fundamental frequency of the input vector. - * \param *result: the even/odd harmonic ratio of N values from the array pointed to by *data - */ -int xtract_odd_even_ratio(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the Sharpness of an input vector - * - * \param *data: a pointer to the first element in an array of doubles representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum(). - * \param N: the number of elements to be considered - * \param *argv: a pointer to NULL - * \param *result: the Sharpness of N values from the array pointed to by *data - */ -int xtract_sharpness(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the Slope of an input vector using a method described by Peeters(2003) - * - * \param *data: a pointer to the first element in an array of doubles representing the spectrum of an audio vector, (e.g. the array pointed to by *result from xtract_spectrum(), xtract_peak_spectrum() or xtract_harmonic_spectrum()). - * \param N: the number of elements to be considered - * \param *argv: a pointer to NULL - * \param *result: the Slope of N values from the array pointed to by *data - */ -int xtract_spectral_slope(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the value of the lowest value in an input vector - * - * \param *data: a pointer to the first element in an array of doubles - * \param N: the number of elements to be considered - * \param *argv: a pointer to a double representing the lower limit for the search. All values in the array pointed to by *data that are below or equal to this threshold will be ignored. - * \param *result: a pointer to a value representing the lowest component in *data that falls above a given threshold. - * - * \return XTRACT_SUCCESS is a lowest value was found or XTRACT_NO_VALUE if all values - * in the array pointed to by *data are below or equal to the threshold set with *argv - * - * \note If XTRACT_NO_VALUE is returned, *result will be set to DBL_MAX - * - */ -int xtract_lowest_value(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the value of the highest value in an input vector - * - * \param *data: a pointer to the first element in an array of doubles - * \param N: the number of elements to be considered - * \param *argv: a pointer to NULL. - * \param *result: a pointer to a value representing the highest component in *data. - * - */ -int xtract_highest_value(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the sum of the values in an input vector - * - * \param *data: a pointer to the first element in an array of doubles - * \param N: the number of elements to be considered - * \param *argv: a pointer to NULL. - * \param *result: a pointer to a value representing the sum of all of the values pointed to by *data. - * - */ -int xtract_sum(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the Pitch of an input vector using Harmonic Product Spectrum (HPS) analysis - * - * \param *data: a pointer to the first element in an array of doubles representing the spectrum of an audio vector (e.g. *result from xtract_spectrum). It is expected that the first half of the array pointed to by *data will contain amplitudes for each frequecy bin, and the second half will contain the respective frequencies - * \param N: The length of the vector pointed to by *data. - * \param *argv: a pointer to NULL - * \param *result: the pitch of N values from the array pointed to by *data - */ -int xtract_hps(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the fundamental frequency of an input vector - * - * \param *data: a pointer to the first element in an array of doubles representing an audio vector - * \param N: the number of elements to be considered - * \param *argv: a pointer to a double representing the audio sample rate - * \param *result: the pitch of N values from the array pointed to by *data - * - * This algorithm is based on the AMDF, with peak and centre clipping. It would benefit from further improvements to improve noise robustness and overall efficiency - * - * It is based on suggestion by Robert Bristow-Johnson in a discussion on the comp.dsp mailing list, subject "Reference implementation of pitch detection" - * - */ -int xtract_f0(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the fundamental frequency of an input vector - * - * \param *data: a pointer to the first element in an array of doubles representing an audio vector - * \param N: the number of elements to be considered - * \param *argv: a pointer to a double representing the audio sample rate - * \param *result: the pitch of N values from the array pointed to by *data - * - * This function wraps xtract_f0, but provides the frequency of the lowest partial in the peak spectrum if f0 can't be found. - * - */ -int xtract_failsafe_f0(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the fundamental frequency of an input vector using wavelet-based method - * - * \param *data: a pointer to the first element in an array of doubles representing an audio vector - * \param N: the number of elements to be considered - * \param *argv: a pointer to a double representing the audio sample rate - * \param *result: the pitch of N values from the array pointed to by *data - * - * This function uses the time-domain wavelet-based method described in Larson and Maddox (2005) and - * implemented in the dywapitchtrack library - * - * xtract_init_wavelet_f0_state() must be called exactly once prior to calling xtract_wavelet_f0() - * - */ -int xtract_wavelet_f0(const double *data, const int N, const void *argv, double *result); - - -/** \brief Convenience function to convert a frequency in Hertz to a "pitch" value in MIDI cents - * - * \param *data: not used - * \param N: not used - * \param *argv: a pointer to a double-precision floating point value representing a frequency in Hertz - * \param *result: a pointer to a double-precision floating point value representing a "pitch" in MIDI cents - * \return if *argv value causes a *result within the range 0..127, XTRACT_SUCCESS will be returned, otherwise XTRACT_ARGUMENT_ERROR - * - */ -int xtract_midicent(const double *data, const int N, const void *argv, double *result); - - -/** \brief Extract the number of non-zero elements in an input vector - * - * \param *data: a pointer to the first element in an array of doubles - * \param N: the number of elements to be considered - * \param *argv: not used - * \param *result: the number of non-zero elements in the array pointed to by *data - * - */ -int xtract_nonzero_count(const double *data, const int N, const void *argv, double *result); - -/** - * \brief Return XTRACT_SUCCESS if the 'current' value is considered a peak - * - * @param data a pointer to an array containing time series as provided by *result from xtract_last_n() where the Nth value is considered the 'current' value - * @param N an integer representing the number of elements in the time series - * @param argv a pointer to a double representing the threshold, whereby the current value will be considered a peak if it is above the average of the last N values (*data) by the threshold - * @param result a pointer to a copy of the current value if the current value is considered a peak - * - * - * @return XTRACT_SUCCESS if a peak was found or XTRACT_NO_RESULT if not - */ -int xtract_peak(const double *data, const int N, const void *argv, double *result); - - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/xtract/xtract_stateful.h b/xtract/xtract_stateful.h deleted file mode 100644 index 6a5c900..0000000 --- a/xtract/xtract_stateful.h +++ /dev/null @@ -1,66 +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. - * - */ - -/** \file xtract_stateful.h: declares functions that extract features that require stateful data to be retained between frames */ -#ifndef XTRACT_STATEFUL_H -#define XTRACT_STATEFUL_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \defgroup stateful feature extraction functions and data structures - * - * Functions that extract a feature over multiple frames - * - * @{ - */ - - -#include -#include - -typedef struct xtract_last_n_state_ xtract_last_n_state; - -xtract_last_n_state *xtract_last_n_state_new(size_t capacity); -void xtract_last_n_state_delete(xtract_last_n_state *last_n_state); - - -/** - * Write a vector of the last N input values to `result` - * - * @param state a pointer to an xtract_peak_picker_state struct as allocated by xtract_peak_picker_state_new() - * @param data a pointer to a double representing the current input value - * @param N an integer representing 'N' the number of values to be written to *result - * @param argv a pointer to NULL - * @param result a pointer to an array of doubles representing the last N values, where the nth value is the current one. The array must have been allocated to size N elements and initialised by the caller - * - */ -int xtract_last_n(const xtract_last_n_state *state, const double *data, const int N, const void *argv, double *result); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/xtract/xtract_types.h b/xtract/xtract_types.h deleted file mode 100644 index fe75b6e..0000000 --- a/xtract/xtract_types.h +++ /dev/null @@ -1,48 +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. - * - */ - -/* \file xtract_types.h: declares specialised variable types used by libxtract */ - -#ifndef XTRACT_TYPES_H -#define XTRACT_TYPES_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* \brief Data structure used to store amplitude data between calls to xtract_attack_time and other functions. */ -typedef struct _xtract_amp_tracker { - int count; - double previous_amp; -} xtract_amp_tracker; - -typedef struct _xtract_frame_tracker { - int frame_count; - double *previous_frame; -} xtract_frame_tracker; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/xtract/xtract_vector.h b/xtract/xtract_vector.h deleted file mode 100644 index f935da6..0000000 --- a/xtract/xtract_vector.h +++ /dev/null @@ -1,188 +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. - * - */ - -/** \file xtract_vector.h: declares functions that extract a feature as a vector from an input vector */ - -#ifndef XTRACT_VECTOR_H -#define XTRACT_VECTOR_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \defgroup vector vector extraction functions - * - * Functions that extract a feature as a vector from an input vector - * - * @{ - */ - -/** \brief Extract frequency domain spectrum from time domain signal - * - * \param *data: a pointer to the first element in an array of doubles representing an audio vector - * \param N: the number of array elements to be considered - * \param *argv: a pointer to an array of doubles, the first representing (samplerate / N), the second will be cast to an integer and determines the spectrum type (e.g. XTRACT_MAGNITUDE_SPECTRUM, XTRACT_LOG_POWER_SPECTRUM). The third argument determines whether or not the DC component is included in the output. If argv[2] == 1, then the DC component is included in which case the size of the array pointed to by *result must be N+2. For any further use of the array pointed to by *result, the value of N must reflect the (larger) array size. The fourth argument determines whether the magnitude/power coefficients are to be normalised. If argv[3] == 1, then the coefficients are normalised. - * \param *result: a pointer to an array of size N containing N/2 magnitude/power/log magnitude/log power coefficients and N/2 bin frequencies. - * - * The magnitude/power coefficients are scaled to the range 0-1 so that for a given coefficient x, 0 <= x <= 1 - * - * \note Before calling xtract_spectrum(), the FFT must be initialised by calling xtract_init_fft(N, XTRACT_SPECTRUM) - * - */ -int xtract_spectrum(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract autocorrelation from time domain signal using FFT based method - * - * \param *data: a pointer to the first element in an array of doubles representing an audio vector - * \param N: the number of array elements to be considered - * \param *argv: a pointer to NULL - * \param *result: the autocorrelation of N values from the array pointed to by *data - */ -int xtract_autocorrelation_fft(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract Mel Frequency Cepstral Coefficients based on a method described by Rabiner - * - * \param *data: a pointer to the first element in an array of spectral magnitudes, e.g. the first half of the array pointed to by *resul from xtract_spectrum() - * \param N: the number of array elements to be considered - * \param *argv: a pointer to a data structure of type xtract_mel_filter, containing n_filters coefficient tables to make up a mel-spaced filterbank - * \param *result: a pointer to an array containing the resultant MFCC - * - * The data structure pointed to by *argv must be obtained by first calling xtract_init_mfcc - */ -int xtract_mfcc(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the Discrete Cosine transform of a time domain signal - * \param *data: a pointer to the first element in an array of doubles representing an audio vector - * \param N: the number of array elements to be considered - * \param *argv: a pointer to NULL - * \param *result: a pointer to an array containing resultant dct coefficients - */ -int xtract_dct(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract autocorrelation from time domain signal using time-domain autocorrelation technique - * - * \param *data: a pointer to the first element in an array of doubles representing an audio vector - * \param N: the number of array elements to be considered - * \param *argv: a pointer to NULL - * \param *result: the autocorrelation of N values from the array pointed to by *data - */ -int xtract_autocorrelation(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract Average Magnitude Difference Function from time domain signal - * - * \param *data: a pointer to the first element in an array of doubles representing an audio vector - * \param N: the number of array elements to be considered - * \param *argv: a pointer to NULL - * \param *result: the AMDF of N values from the array pointed to by *data - */ -int xtract_amdf(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract Average Squared Difference Function from time domain signal - * - * \param *data: a pointer to the first element in an array of doubles representing an audio vector - * \param N: the number of array elements to be considered - * \param *argv: a pointer to NULL - * \param *result: the ASDF of N values from the array pointed to by *data - */ -int xtract_asdf(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract Bark band coefficients based on a method - * \param *data: a pointer to the first element in an array of doubles representing the magnitude coefficients from the magnitude spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum(). - * \param N: the number of array elements to be considered - * \param *argv: a pointer to an array of ints representing the limits of each bark band. This can be obtained by calling xtract_init_bark. - * \param *result: a pointer to an array containing resultant bark coefficients - * - * The limits array pointed to by *argv must be obtained by first calling xtract_init_bark - * - */ -int xtract_bark_coefficients(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the amplitude and frequency of spectral peaks from a magnitude spectrum - * \param *data: a pointer to an array of size N containing N magnitude/power/log magnitude/log power coefficients. (e.g. the first half of the array pointed to by *result from xtract_spectrum(). - * \param N: the size of the input array (note: it is assumed that enough memory has been allocated for an output array twice the size) - * \param *argv: a pointer to an array of doubles, the first representing (samplerate / N), the second representing the peak threshold as percentage of the magnitude of the maximum peak found - * \param *result: a pointer to an array of size N * 2 containing N magnitude/power/log magnitude/log power coefficients and N bin frequencies. - * - */ -int xtract_peak_spectrum(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract the harmonic spectrum of from a of a peak spectrum - * \param *data: a pointer to the first element in an array of doubles representing the peak spectrum of an audio vector (e.g. *result from xtract_peaks). It is expected that the first half of the array pointed to by *data will contain amplitudes for each peak considered, and the the second half will contain the respective frequencies - * \param N: the size of the array pointed to by *data - * \param *argv: a pointer to an array containing the fundamental (f0) of the spectrum, and a threshold (t) where 0<=t<=1.0, and t determines the distance from the nearest harmonic number within which a partial can be considered harmonic. - * \param *result: a pointer to an array of size N containing N/2 magnitude coefficients and N/2 bin frequencies. - */ -int xtract_harmonic_spectrum(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract Linear Predictive Coding Coefficients - * - * Based on algorithm in Rabiner and Juang as implemented by Jutta Degener in Dr. Dobb's Journal December, 1994. - * - * Returns N-1 reflection (PARCOR) coefficients and N-1 LPC coefficients via *result - * - * \param *data: N autocorrelation values e.g the data pointed to by *result from xtract_autocorrelation() - * \param N: the number of autocorrelation values to be considered - * \param *argv: a pointer to NULL - * \param *result: a pointer to an array containing N-1 reflection coefficients and N-1 LPC coefficients. - * - * An array of size 2 * (N - 1) must be allocated, and *result must point to its first element. - */ -int xtract_lpc(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract Linear Predictive Coding Cepstral Coefficients - * - * \param *data: a pointer to the first element in an array of LPC coeffiecients e.g. a pointer to the second half of the array pointed to by *result from xtract_lpc() - * \param N: the number of LPC coefficients to be considered - * \param *argv: a pointer to a double representing the order of the result vector. This must be a whole number. According to Rabiner and Juang the ratio between the number (p) of LPC coefficients and the order (Q) of the LPC cepstrum is given by Q ~ (3/2)p where Q > p. - * \param *result: a pointer to an array containing the resultant LPCC. - * - * An array of size Q, where Q is given by argv[0] must be allocated, and *result must point to its first element. - * - */ -int xtract_lpcc(const double *data, const int N, const void *argv, double *result); - -/** \brief Extract subbands from a spectrum - * - * \param *data: a pointer to an array of size N containing N magnitude/power/log magnitude/log power coefficients. (e.g. the first half of the array pointed to by *result from xtract_spectrum(). - * \param N: the number of elements from the array pointed to by *data to be considered - * \param *argv: A pointer to an array containing four integers. The first represents the extraction function to applied to each subband e.g. XTRACT_SUM or XTRACT_MEAN, the second represents the number of subbands required, and the third represents the frequency scale to be used for the subband bounds as defined in the enumeration xtract_subband_scales_ (libxtract.h). The fourth integer represent the start point of the subbands as a location in the input array as pointed to by *data (e.g. a value of 5 would start the subband extraction at bin 5) - * \param *result: A pointer to an array containing the resultant subband values. The calling function is responsible for allocating and freeing memory for *result. xtract_subbands() assumes that at least argv[1] * sizeof(double) bytes have been allocated. If the requested nbands extends the subband range beyond N, then the remaining bands will be set to 0. If the array pointed to by *result has more than argv[1] elements, the superfluous elements will be unchanged. - * - * xtract_subbands() divides a spectrum into subbands and applies the function given by argv[0] to the values in each subband to give a 'reduced' representation of the spectrum as *result - * - * Specifying XTRACT_OCTAVE_SUBBANDS will extract subbands at each octave from the start bin until argv[1] is reached or N is reached - * Specifying XTRACT_LINEAR_SUBBANDS will extract argv[1] equal sized subbands between the start bin and N - * - * - * It is assumed that a sensible function will be given in argv[0], and for this function argv will always be NULL. Sensible values for argv[0] are XTRACT_MEAN and XTRACT_SUM, although something like XTRACT_IRREGULARITY_K might yield interesting results. - * - */ -int xtract_subbands(const double *data, const int N, const void *argv, double *result); -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif -- cgit v1.2.3 From dbf585ec3763e25db5c34338cbf34af9035fe40f Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Fri, 7 Nov 2014 13:10:51 +0000 Subject: Add "install" target --- Makefile | 10 +++++++++- examples/Makefile | 12 +++++++++--- examples/simpletest/Make.config | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index ece416f..250d37a 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,10 @@ +PREFIX = dist + static: LIBTYPE = static shared: LIBTYPE = shared -.PHONY: examples clean static shared +.PHONY: examples clean static shared install all: static examples @@ -12,6 +14,12 @@ static shared: examples: @$(MAKE) -C examples +install: + $(MAKE) -C src install PREFIX=$(PWD)/$(PREFIX) + $(MAKE) -C examples install PREFIX=$(PWD)/$(PREFIX) + @mkdir -p $(PREFIX)/include/xtract + @cp include/xtract/* $(PREFIX)/include/xtract + clean: @$(MAKE) -C src clean @$(MAKE) -C examples clean diff --git a/examples/Makefile b/examples/Makefile index 46ef826..94ae71d 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -1,8 +1,14 @@ -.PHONY: simpletest clean +NAME = simpletest -simpletest: +.PHONY: $(NAME) clean + +$(NAME): @$(MAKE) -C $@ +install: + @$(MAKE) -C $(NAME) install + + clean: - @$(MAKE) -C simpletest clean + @$(MAKE) -C $(NAME) clean diff --git a/examples/simpletest/Make.config b/examples/simpletest/Make.config index 6d21ed7..9f3640a 100644 --- a/examples/simpletest/Make.config +++ b/examples/simpletest/Make.config @@ -5,5 +5,5 @@ endif LIBRARY := SUFFIX := .cpp -FLAGS += -I../../ +FLAGS += -I../../include LDFLAGS = -lxtract -L../../src $(DARWIN_LDFLAGS) -- cgit v1.2.3 From 57a8d239714160a09cbbce037a2659510aa64b87 Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Fri, 7 Nov 2014 13:11:15 +0000 Subject: Tidy up .gitignore --- .gitignore | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 9361f92..b56e1a3 100644 --- a/.gitignore +++ b/.gitignore @@ -8,16 +8,8 @@ # Shared objects (inc. Windows DLLs) *.dll *.so -*.so.* *.dylib -# Executables -*.exe -*.out -*.app -*.pd_* -examples/simpletest/simpletest - # VS files *.sdf *.tlog @@ -32,6 +24,10 @@ examples/simpletest/simpletest # Doxygen doc/latex doc/html -doc/doxygen-build.stamp -doc/documentation.doxygen +# Build files +.build +dist + +# Project-specific files +examples/simpletest/simpletest -- cgit v1.2.3 From a2fd76be93a535d7c49a1b9dc3903be09ddfb7b7 Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Fri, 7 Nov 2014 13:11:34 +0000 Subject: Delete unneeded files --- ChangeLog | 134 ----- doc/documentation.doxygen.in | 1295 ------------------------------------------ 2 files changed, 1429 deletions(-) delete mode 100644 ChangeLog delete mode 100644 doc/documentation.doxygen.in 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 - * 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 - * 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 - * 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 - * 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 - * version 0.4.8 - * Added cursory SWIG Python wrapper generator - -2007-04-20 Jamie Bullock - * version 0.4.7 - * Added MSP example - -2007-04-20 Jamie Bullock - * version 0.4.5 - * Fixed autocorrelation_fft() - * Added MAINTAINERCLEAN files to Makefile.am - -2007-03-14 Jamie Bullock - * 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 - * 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 - * 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 - * 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 - * 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 - * version 0.3.1 - * Fixed xtract_init_mfcc (array entries zeroed out if not set) -2006-11-10 Jamie Bullock - * 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 - * 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 - * version 0.2.1 - * Fixed _xtract and _xtract_help_strings memory alloc bug - * Added new macro - _ -2006-10-18 Jamie Bullock - * version 0.2.0 - * added PD help files - * added simple help system - -2006-10-12 Jamie Bullock - * version 0.1.2 - * improved xtract_f0 - * changed versioning scheme - -2006-10-09 Jamie Bullock - * Released version 0.11 - - - diff --git a/doc/documentation.doxygen.in b/doc/documentation.doxygen.in deleted file mode 100644 index 6e4d48c..0000000 --- a/doc/documentation.doxygen.in +++ /dev/null @@ -1,1295 +0,0 @@ -# Doxyfile 1.5.3 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file that -# follow. The default is UTF-8 which is also the encoding used for all text before -# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into -# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of -# possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = LibXtract - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = @PACKAGE_VERSION@ - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, -# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, -# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, -# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. - -DETAILS_AT_TOP = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to -# include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be extracted -# and appear in the documentation as a namespace called 'anonymous_namespace{file}', -# where file will be replaced with the base name of the file that contains the anonymous -# namespace. By default anonymous namespace are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from the -# version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = @top_srcdir@/xtract -#INPUT = - -# 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 -# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. -# See http://www.gnu.org/software/libiconv for the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = NO - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the output. -# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, -# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH -# then you must also enable this option. If you don't then doxygen will produce -# a warning and turn it on anyway - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. Otherwise they will link to the documentstion. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = NO - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = YES - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = pdflatex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4 - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to -# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to -# specify the directory where the mscgen tool resides. If left empty the tool is assumed to -# be found in the default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will -# generate a call dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will -# generate a caller dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable caller graphs for selected -# functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the number -# of direct children of the root node in a graph is already larger than -# MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, which results in a white background. -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should be -# used. If set to NO the values of all tags below this one will be ignored. - -SEARCHENGINE = NO -- cgit v1.2.3 From 8a49f7c3a38fb3f50491dfe962b981e17c9716f4 Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Fri, 7 Nov 2014 14:46:17 +0000 Subject: Add Doxygen to build system --- Makefile | 27 +- VERSION | 1 + doc/Doxyfile | 1294 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ doc/Makefile | 6 + 4 files changed, 1318 insertions(+), 10 deletions(-) create mode 100644 VERSION create mode 100644 doc/Doxyfile create mode 100644 doc/Makefile diff --git a/Makefile b/Makefile index 250d37a..16e7c22 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,32 @@ -PREFIX = dist +PREFIX ?= $(PWD)/dist +HPATH = include/xtract -static: LIBTYPE = static -shared: LIBTYPE = shared +static: LIBRARY = static +shared: LIBRARY = shared -.PHONY: examples clean static shared install +export XTRACT_VERSION PREFIX LIBRARY + +.PHONY: examples clean static shared install doc all: static examples static shared: - @$(MAKE) -C src LIBRARY=$(LIBTYPE) + @$(MAKE) -C src examples: - @$(MAKE) -C examples + @$(MAKE) -C $@ + +doc: + @$(MAKE) -C $@ install: - $(MAKE) -C src install PREFIX=$(PWD)/$(PREFIX) - $(MAKE) -C examples install PREFIX=$(PWD)/$(PREFIX) - @mkdir -p $(PREFIX)/include/xtract - @cp include/xtract/* $(PREFIX)/include/xtract + $(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 + @$(RM) -r dist diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..7486fdb --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.7.2 diff --git a/doc/Doxyfile b/doc/Doxyfile new file mode 100644 index 0000000..e079aac --- /dev/null +++ b/doc/Doxyfile @@ -0,0 +1,1294 @@ +# Doxyfile 1.5.3 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file that +# follow. The default is UTF-8 which is also the encoding used for all text before +# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into +# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of +# possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = LibXtract + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, +# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, +# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, +# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for Java. +# For instance, namespaces will be presented as packages, qualified scopes +# will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to +# include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be extracted +# and appear in the documentation as a namespace called 'anonymous_namespace{file}', +# where file will be replaced with the base name of the file that contains the anonymous +# namespace. By default anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from the +# version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +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 +# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. +# See http://www.gnu.org/software/libiconv for the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the output. +# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, +# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH +# then you must also enable this option. If you don't then doxygen will produce +# a warning and turn it on anyway + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentstion. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = YES + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = pdflatex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4 + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to +# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to +# specify the directory where the mscgen tool resides. If left empty the tool is assumed to +# be found in the default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = YES + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will +# generate a call dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will +# generate a caller dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable caller graphs for selected +# functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the number +# of direct children of the root node in a graph is already larger than +# MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, which results in a white background. +# Warning: Depending on the platform used, enabling this option may lead to +# badly anti-aliased labels on the edges of a graph (i.e. they become hard to +# read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO 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 -- cgit v1.2.3 From 920219c77cd9d7d34ec1bfceb0511eb33402483b Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Fri, 7 Nov 2014 16:11:42 +0000 Subject: Remove unmaintainable relative paths --- src/delta.c | 2 +- src/descriptors.c | 2 +- src/fini.c | 2 +- src/helper.c | 2 +- src/init.c | 2 +- src/libxtract.c | 2 +- src/scalar.c | 4 ++-- src/stateful.c | 4 ++-- src/vector.c | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) 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 -#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 #include diff --git a/src/fini.c b/src/fini.c index 9d51a77..d84bdd6 100644 --- a/src/fini.c +++ b/src/fini.c @@ -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 -#include "../xtract/libxtract.h" +#include "xtract/libxtract.h" #ifdef WORDS_BIGENDIAN #define INDEX 0 diff --git a/src/init.c b/src/init.c index f7962fa..4a0467c 100644 --- a/src/init.c +++ b/src/init.c @@ -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" -- cgit v1.2.3 From 254bc42e4b1093419754da4a82281653025f52b4 Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Fri, 7 Nov 2014 16:12:11 +0000 Subject: Various improvements --- Makefile | 21 ++++++++++----------- src/Make.config | 1 + 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 16e7c22..e2f1cbb 100644 --- a/Makefile +++ b/Makefile @@ -1,28 +1,27 @@ +LIBRARY ?= static PREFIX ?= $(PWD)/dist -HPATH = include/xtract -static: LIBRARY = static -shared: LIBRARY = shared +HPATH = include/xtract export XTRACT_VERSION PREFIX LIBRARY -.PHONY: examples clean static shared install doc +.PHONY: examples clean install doc src -all: static examples +all: src examples -static shared: - @$(MAKE) -C src - -examples: +src: @$(MAKE) -C $@ doc: @$(MAKE) -C $@ +examples: + @$(MAKE) -C $@ + install: - $(MAKE) -C src install - $(MAKE) -C examples install + @$(MAKE) -C src install + @$(MAKE) -C examples install @mkdir -p $(PREFIX)/$(HPATH) @cp $(HPATH)/* $(PREFIX)/$(HPATH) diff --git a/src/Make.config b/src/Make.config index 202c0ab..75d5abe 100644 --- a/src/Make.config +++ b/src/Make.config @@ -1,5 +1,6 @@ NAME := xtract DIRS := . c-ringbuf ooura dywapitchtrack +FLAGS := -I../include ifeq ($(PLATFORM), Darwin) LDFLAGS = -framework Accelerate -- cgit v1.2.3 From 56d30a86198b3d063b11d7d465a356a4ffbb03a0 Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Fri, 7 Nov 2014 23:58:26 +0000 Subject: Remove Java bindings --- swig/java/jxtract.i | 73 ----------------------------------------------------- swig/java/test.java | 36 -------------------------- 2 files changed, 109 deletions(-) delete mode 100644 swig/java/jxtract.i delete mode 100644 swig/java/test.java 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"); - } -} -- cgit v1.2.3 From 89a9ec7a352dc35141b8f9a87c202fdd448e9a6f Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Sat, 8 Nov 2014 00:06:06 +0000 Subject: Add Python bindings to build system --- Makefile | 6 +++++- swig/Makefile | 31 +++++++++++++++++++++++++++ swig/python/.gitignore | 2 -- swig/python/__init__.py | 0 swig/python/test.py | 57 ------------------------------------------------- swig/test.py | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 93 insertions(+), 60 deletions(-) create mode 100644 swig/Makefile delete mode 100644 swig/python/.gitignore delete mode 100644 swig/python/__init__.py delete mode 100644 swig/python/test.py create mode 100644 swig/test.py diff --git a/Makefile b/Makefile index e2f1cbb..e880ca9 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ HPATH = include/xtract export XTRACT_VERSION PREFIX LIBRARY -.PHONY: examples clean install doc src +.PHONY: examples clean install doc src swig all: src examples @@ -19,6 +19,9 @@ doc: examples: @$(MAKE) -C $@ +swig: src + @$(MAKE) -C $@ + install: @$(MAKE) -C src install @$(MAKE) -C examples install @@ -28,4 +31,5 @@ install: clean: @$(MAKE) -C src clean @$(MAKE) -C examples clean + @$(MAKE) -C swig clean @$(RM) -r dist 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/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/__init__.py b/swig/python/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/swig/python/test.py b/swig/python/test.py deleted file mode 100644 index a89a6f9..0000000 --- a/swig/python/test.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/python - -try: - import libxtract.xtract as xtract -except ImportError: - print 'Failed to load the library "xtract"' - -print '\nRunning libxtract Python bindings test...\n' - -len = 8 - -a = xtract.doubleArray(len) -temp = [] - -for i in range(0, len): - a[i] = 2 * i - temp.append(str(a[i])) - -mean = xtract.xtract_mean(a,len,None)[1] - -print 'The mean of ' + ', '.join(temp) + ' is: %.2f' % mean - -argv = xtract.doubleArray(1) -argv[0] = mean - -variance = xtract.xtract_variance(a, len, argv)[1] - -print 'The variance is %.2f' % variance - -print 'Computing spectrum...' - -argv = xtract.doubleArray(1) -argv[0] = 44100.0 / len # Fake sample rate - -xtract.xtract_init_fft(len, xtract.XTRACT_SPECTRUM); - -result = xtract.doubleArray(len) - -xtract.xtract_spectrum(a,len,argv, result) - - -for i in range(len): - print result[i] - - -print 'Computing windowed subframes...' - -for i in range(0, len): - a[i] = 1.0 - -window = xtract.xtract_init_window(len / 2, xtract.XTRACT_HANN) -xtract.xtract_features_from_subframes(a, len, xtract.XTRACT_WINDOWED, window, result) - -for i in range(len): - print result[i] - -print '\nFinished!\n' diff --git a/swig/test.py b/swig/test.py new file mode 100644 index 0000000..4d14171 --- /dev/null +++ b/swig/test.py @@ -0,0 +1,57 @@ +#!/usr/bin/python + +try: + import xtract +except ImportError: + print 'Failed to load the library "xtract"' + +print '\nRunning libxtract Python bindings test...\n' + +len = 8 + +a = xtract.doubleArray(len) +temp = [] + +for i in range(0, len): + a[i] = 2 * i + temp.append(str(a[i])) + +mean = xtract.xtract_mean(a,len,None)[1] + +print 'The mean of ' + ', '.join(temp) + ' is: %.2f' % mean + +argv = xtract.doubleArray(1) +argv[0] = mean + +variance = xtract.xtract_variance(a, len, argv)[1] + +print 'The variance is %.2f' % variance + +print 'Computing spectrum...' + +argv = xtract.doubleArray(1) +argv[0] = 44100.0 / len # Fake sample rate + +xtract.xtract_init_fft(len, xtract.XTRACT_SPECTRUM); + +result = xtract.doubleArray(len) + +xtract.xtract_spectrum(a,len,argv, result) + + +for i in range(len): + print result[i] + + +print 'Computing windowed subframes...' + +for i in range(0, len): + a[i] = 1.0 + +window = xtract.xtract_init_window(len / 2, xtract.XTRACT_HANN) +xtract.xtract_features_from_subframes(a, len, xtract.XTRACT_WINDOWED, window, result) + +for i in range(len): + print result[i] + +print '\nFinished!\n' -- cgit v1.2.3