diff options
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | configure.in | 6 | ||||
-rw-r--r-- | examples/puredata/xtract~.c | 23 | ||||
-rw-r--r-- | src/init.c | 2 | ||||
-rw-r--r-- | src/libxtract.c | 46 | ||||
-rw-r--r-- | xtract/libxtract.h | 7 |
7 files changed, 85 insertions, 14 deletions
@@ -1,9 +1,15 @@ -2006-09-10 Jamie Bullock <jamie@postlude.co.uk> - * Released version 0.1.1 - -2006-09-10 Jamie Bullock <jamie@postlude.co.uk> +2006-18-10 Jamie Bullock <jamie@postlude.co.uk> + * version 0.2.0 + * added PD help files + * added simple help system + +2006-12-10 Jamie Bullock <jamie@postlude.co.uk> * version 0.1.2 * improved xtract_f0 * changed versioning scheme +2006-09-10 Jamie Bullock <jamie@postlude.co.uk> + * Released version 0.11 + + @@ -1,5 +1,4 @@ Improve noise robustness of xtract_f0 -Add help facilities Add feature advertisement Fix xtract_hps - it doesn't work! Add Pure Data help file diff --git a/configure.in b/configure.in index 93adda2..47001c0 100644 --- a/configure.in +++ b/configure.in @@ -1,10 +1,10 @@ AC_PREREQ(2.13) -# Increment for major changes, e.g. new feature types, major API changes +# 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, 1) +m4_define(libxtract_minor_version, 2) # Increment for fixes -m4_define(libxtract_fix_version, 2) +m4_define(libxtract_fix_version, 0) m4_define(libxtract_version, libxtract_major_version.libxtract_minor_version.libxtract_fix_version) diff --git a/examples/puredata/xtract~.c b/examples/puredata/xtract~.c index 6c65e4b..9f81f57 100644 --- a/examples/puredata/xtract~.c +++ b/examples/puredata/xtract~.c @@ -124,7 +124,7 @@ static void *xtract_new(t_symbol *me, t_int argc, t_atom *argv) { else if(tmp == gensym("slope")) x->feature = SLOPE; else if(tmp == gensym("f0")){ x->feature = F0; - x->argv = getbytes(sizeof(t_float)); + x->argv = getbytes(3 * sizeof(t_float)); } else if(tmp == gensym("hps"))x->feature = HPS; else if(tmp == gensym("lowest_match")){ @@ -181,8 +181,6 @@ static void *xtract_new(t_symbol *me, t_int argc, t_atom *argv) { x->feature_type = DELTA; else x->feature_type = SCALAR; - - post("Type: %d", x->feature); /* argv through right inlet */ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("list"), gensym("list")); @@ -212,6 +210,19 @@ t_int argc, t_atom *argv) { /* }*/ } +static void xtract_tilde_show_help(t_xtract_tilde *x, t_symbol *s){ + + int i; + + i = XTRACT_FEATURES; + + post("\n\txtract~: Feature List\n"); + + while(i--){ + post("\t%s", xtract_help_strings[i]+7); + } +} + static void xtract_tilde_free(t_xtract_tilde *x) { /*FIX */ if(x->argv != NULL) @@ -227,9 +238,11 @@ void xtract_tilde_setup(void) { A_GIMME, 0); class_addmethod(xtract_class, - (t_method)xtract_dsp, gensym("dsp"), 0); + (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_get_args, gensym("list"), A_GIMME, 0); + (t_method)xtract_tilde_show_help, gensym("help"), A_DEFSYMBOL, 0); CLASS_MAINSIGNALIN(xtract_class, t_xtract_tilde, f); class_sethelpsymbol(xtract_class, gensym("help-flib")); } @@ -22,7 +22,7 @@ #include "xtract/libxtract.h" #include <math.h> -#include <string.h> +#include <stdlib.h> int xtract_init_mfcc(int N, float nyquist, int style, float freq_max, float freq_min, int freq_bands, float **fft_tables){ diff --git a/src/libxtract.c b/src/libxtract.c index 8202f6d..5e1cdf2 100644 --- a/src/libxtract.c +++ b/src/libxtract.c @@ -18,6 +18,7 @@ * USA. */ + #include "xtract/libxtract.h" #define XTRACT @@ -70,3 +71,48 @@ int(*xtract[])(float *, int, void *, float *) = { xtract_delta_feature }; +char *xtract_help_strings[] = { + "xtract_mean", + "xtract_variance", + "xtract_standard_deviation", + "xtract_average_deviation", + "xtract_skewness", + "xtract_kurtosis", + "xtract_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_tonality", + "xtract_crest", + "xtract_noisiness", + "xtract_rms_amplitude", + "xtract_inharmonicity", + "xtract_power", + "xtract_odd_even_ratio", + "xtract_sharpness", + "xtract_slope", + "xtract_lowest_match", + "xtract_hps", + "xtract_f0", + "xtract_magnitude_spectrum", + "xtract_autocorrelation", + "xtract_autocorrelation_fft", + "xtract_amdf", + "xtract_asdf", + "xtract_mfcc", + "xtract_dct", + "xtract_bark_coefficients", + "xtract_peaks", + "xtract_flux", + "xtract_attack_time", + "xtract_decay_time", + "xtract_delta_feature" +}; diff --git a/xtract/libxtract.h b/xtract/libxtract.h index 5de0e32..627046d 100644 --- a/xtract/libxtract.h +++ b/xtract/libxtract.h @@ -178,6 +178,13 @@ printf("Mean = %.2f\n", mean); int(*xtract[XTRACT_FEATURES])(float *data, int N, void *argv, float *result); #endif + +/** \brief An array of pointers to function help strings + * + * Defined in libxtract.c. As a minimum this will contain pointers to the names of all of the feature extraction functions in the library. This is intended as a 'quick reference' to be queried as necessary. + */ +char *xtract_help_strings[XTRACT_FEATURES]; + /** \brief A structure to store a set of n_filters Mel filters */ typedef struct xtract_mel_filter_ { int n_filters; |