examples/: set threshold as needed
authorPaul Brossier <piem@piem.org>
Wed, 21 Oct 2009 13:08:24 +0000 (15:08 +0200)
committerPaul Brossier <piem@piem.org>
Wed, 21 Oct 2009 13:08:24 +0000 (15:08 +0200)
examples/aubionotes.c
examples/aubioonset.c
examples/aubiotrack.c
examples/utils.c

index 676985a..d8473dc 100644 (file)
@@ -147,6 +147,7 @@ int main(int argc, char **argv) {
 
   o = new_aubio_onset (onset_mode, buffer_size, overlap_size, channels,
           samplerate);
+  if (threshold != 0.) aubio_onset_set_threshold (o, threshold);
   onset = new_fvec (1, channels);
 
   pitchdet = new_aubio_pitch (pitch_mode, buffer_size * 4,
index 2c1a186..9cd9654 100644 (file)
@@ -78,6 +78,7 @@ int main(int argc, char **argv) {
 
   o = new_aubio_onset (onset_mode, buffer_size, overlap_size, channels,
           samplerate);
+  if (threshold != 0.) aubio_onset_set_threshold (o, threshold);
   onset = new_fvec (1, channels);
 
   examples_common_process(aubio_process,process_print);
index a83f0a2..8e9b84e 100644 (file)
@@ -83,6 +83,7 @@ int main(int argc, char **argv) {
 
   tempo_out = new_fvec(2,channels);
   bt = new_aubio_tempo(onset_mode,buffer_size,overlap_size,channels, samplerate);
+  if (threshold != 0.) aubio_tempo_set_threshold (bt, threshold);
 
   examples_common_process(aubio_process,process_print);
 
index 2a648d2..a9e77a2 100644 (file)
@@ -56,7 +56,7 @@ char_t * pitch_mode = "default";
 
 /* energy,specdiff,hfc,complexdomain,phase */
 char_t * onset_mode = "default";
-smpl_t threshold = 0.3;
+smpl_t threshold = 0.0;         // leave unset, only set as asked 
 smpl_t silence = -90.;
 uint_t buffer_size = 512;       //1024;
 uint_t overlap_size = 256;      //512;
@@ -148,17 +148,11 @@ parse_args (int argc, char **argv)
       case 'O':                /*onset type */
         onset_mode = optarg;
         break;
-      case 's':                /* threshold value for onset */
+      case 's':                /* silence value for onset */
         silence = (smpl_t) atof (optarg);
         break;
       case 't':                /* threshold value for onset */
         threshold = (smpl_t) atof (optarg);
-        /*
-           if (!isfinite(threshold)) {
-           debug("could not get threshold.\n");
-           abort();
-           }
-         */
         break;
       case 'p':
         pitch_mode = optarg;