diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/puredata/Makefile.am | 4 | ||||
-rw-r--r-- | examples/simpletest/Makefile.am | 2 | ||||
-rw-r--r-- | examples/simpletest/simpletest.c | 9 |
3 files changed, 10 insertions, 5 deletions
diff --git a/examples/puredata/Makefile.am b/examples/puredata/Makefile.am index a86acb3..ee594d7 100644 --- a/examples/puredata/Makefile.am +++ b/examples/puredata/Makefile.am @@ -15,9 +15,7 @@ xtract_@PD_SUFFIX@_SOURCES = xtract~.c pdincludedir = $(pddir)/src -INCLUDES = -I$(top_srcdir)/src -I$(pdincludedir) - -AM_CFLAGS = @PD_CFLAGS@ +AM_CFLAGS = @PD_CFLAGS@ -I$(top_srcdir)/src -I$(pdincludedir) AM_LDFLAGS = @PD_LDFLAGS@ -lxtract -L$(top_builddir)/src/ ## Install the documentation. diff --git a/examples/simpletest/Makefile.am b/examples/simpletest/Makefile.am index c3ab176..d4d9230 100644 --- a/examples/simpletest/Makefile.am +++ b/examples/simpletest/Makefile.am @@ -1,7 +1,7 @@ MAINTAINERCLEANFILES = Makefile.in noinst_PROGRAMS = simpletest -INCLUDES = -I$(top_srcdir)/src +AM_CFLAGS = -I$(top_srcdir)/src simpletest_SOURCES = simpletest.c simpletest_LDADD = ../../src/libxtract.la diff --git a/examples/simpletest/simpletest.c b/examples/simpletest/simpletest.c index df068c2..50b45f8 100644 --- a/examples/simpletest/simpletest.c +++ b/examples/simpletest/simpletest.c @@ -96,6 +96,7 @@ int main(void) { double mean = 0.0; double f0 = 0.0; + double midicents = 0.0; double flux = 0.0; double centroid = 0.0; double lowest = 0.0; @@ -113,7 +114,9 @@ int main(void) int rv = XTRACT_SUCCESS; xtract_mel_filter mel_filters; - fill_wavetable(344.53125f, NOISE); // 344.53125f = 128 samples @ 44100 Hz + // fill_wavetable(344.53125f, NOISE); // 344.53125f = 128 samples @ 44100 Hz + fill_wavetable(344.53125f, SINE); // 344.53125f = 128 samples @ 44100 Hz + /* print_wavetable(); */ @@ -122,6 +125,10 @@ int main(void) xtract[XTRACT_WAVELET_F0](wavetable, BLOCKSIZE, &samplerate, &f0); printf("\nF0: %f\n", f0); + /* get the F0 as a MIDI note */ + xtract[XTRACT_MIDICENT](NULL, 0, &f0, &midicents); + printf("\nMIDI cents: %f\n", midicents); + /* get the mean of the input */ xtract[XTRACT_MEAN](wavetable, BLOCKSIZE, NULL, &mean); printf("\nInput mean = %.2f\n\n", mean); /* We expect this to be zero for a square wave */ |