ref: 37eb9ceb5cba5492740af27f78e914c43ecdb3b5
parent: 3f16b615652d950e2ed57240ee95c251d1b78085
parent: f650860dacb65b347c215149b51e224d9061dbff
author: Paul Brossier <piem@piem.org>
date: Sat Jan 9 10:35:53 EST 2010
merge from master, print beats once in demo_beat.py
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -10,6 +10,7 @@
aubiomfcc
noinst_PROGRAMS = \
+ aubiopitch
aubioquiet
EXTRA_DIST = utils.h sndfileio.h jackio.h
@@ -19,6 +20,7 @@
aubioonset_SOURCES = aubioonset.c $(COMMON_SOURCE_FILES)
aubionotes_SOURCES = aubionotes.c $(COMMON_SOURCE_FILES)
aubiotrack_SOURCES = aubiotrack.c $(COMMON_SOURCE_FILES)
+aubiopitch_SOURCES = aubiopitch.c $(COMMON_SOURCE_FILES)
aubioquiet_SOURCES = aubioquiet.c $(COMMON_SOURCE_FILES)
aubiomfcc_SOURCES = aubiomfcc.c $(COMMON_SOURCE_FILES)
@@ -25,5 +27,6 @@
aubioonset_LDADD = @SNDFILE_LIBS@ @JACK_LIBS@
aubionotes_LDADD = @SNDFILE_LIBS@ @JACK_LIBS@
aubiotrack_LDADD = @SNDFILE_LIBS@ @JACK_LIBS@
+aubiopitch_LDADD = @SNDFILE_LIBS@ @JACK_LIBS@
aubioquiet_LDADD = @SNDFILE_LIBS@ @JACK_LIBS@
aubiomfcc_LDADD = @SNDFILE_LIBS@ @JACK_LIBS@
--- a/examples/utils.c
+++ b/examples/utils.c
@@ -206,22 +206,6 @@
/* parse command line arguments */
parse_args (argc, argv);
- woodblock = new_fvec (overlap_size);
- if (output_filename || usejack) {
- /* dummy assignement to keep egcs happy */
- found_wood = (onsetfile = new_aubio_sndfile_ro (onset_filename)) ||
- (onsetfile = new_aubio_sndfile_ro ("sounds/woodblock.aiff")) ||
- (onsetfile = new_aubio_sndfile_ro ("../sounds/woodblock.aiff"));
- if (onsetfile == NULL) {
- outmsg ("Could not find woodblock.aiff\n");
- exit (1);
- }
- }
- if (onsetfile) {
- /* read the output sound once */
- aubio_sndfile_read_mono (onsetfile, overlap_size, woodblock);
- }
-
if (!usejack) {
debug ("Opening files ...\n");
file = new_aubio_sndfile_ro (input_filename);
@@ -253,7 +237,22 @@
}
#endif /* HAVE_LASH */
- uint_t i;
+ woodblock = new_fvec (overlap_size);
+ if (output_filename || usejack) {
+ /* dummy assignement to keep egcs happy */
+ found_wood = (onsetfile = new_aubio_sndfile_ro (onset_filename)) ||
+ (onsetfile = new_aubio_sndfile_ro ("sounds/woodblock.aiff")) ||
+ (onsetfile = new_aubio_sndfile_ro ("../sounds/woodblock.aiff"));
+ if (onsetfile == NULL) {
+ outmsg ("Could not find woodblock.aiff\n");
+ exit (1);
+ }
+ }
+ if (onsetfile) {
+ /* read the output sound once */
+ aubio_sndfile_read_mono (onsetfile, overlap_size, woodblock);
+ }
+
ibuf = new_fvec (overlap_size);
obuf = new_fvec (overlap_size);
--- a/interfaces/python/demo_beat.py
+++ b/interfaces/python/demo_beat.py
@@ -25,4 +25,3 @@
a = aubioinput(filename, process = process, hopsize = hop_s,
caps = 'audio/x-raw-float, rate=44100, channels=1')
a.run()
- print beats
--- a/src/spectral/specdesc.c
+++ b/src/spectral/specdesc.c
@@ -273,7 +273,7 @@
else if (strcmp (onset_mode, "default") == 0)
onset_type = aubio_onset_default;
else {
- AUBIO_ERR("unknown spectral descriptor type %s.\n", onset_mode);
+ AUBIO_ERR("unknown spectral descriptor type %s, using default.\n", onset_mode);
onset_type = aubio_onset_default;
}
switch(onset_type) {
--- /dev/null
+++ b/tests/src/test-pitch.c
@@ -1,0 +1,22 @@
+#include <aubio.h>
+
+int main(){
+ /* allocate some memory */
+ uint_t win_s = 1024; /* window size */
+ fvec_t * in = new_fvec (win_s); /* input buffer */
+ fvec_t * out = new_fvec (1); /* input buffer */
+ aubio_pitch_t *p = new_aubio_pitch ("default", win_s, win_s / 2, 44100);
+ uint_t i = 0;
+
+ while (i < 10) {
+ aubio_pitch_do (p, in, out);
+ i++;
+ };
+
+ del_fvec(in);
+ del_fvec(out);
+ aubio_cleanup();
+
+ return 0;
+}
+