shithub: aubio

Download patch

ref: 4c67dc8bfb7d80ff24504d263f509d6295d07462
parent: b965fb19a65e87ca5154c55b685a314fed631997
author: Paul Brossier <piem@altern.org>
date: Thu May 4 10:54:58 EDT 2006

use yinfft by default
use yinfft by default


--- a/examples/utils.c
+++ b/examples/utils.c
@@ -58,7 +58,7 @@
 /* pitch objects */
 smpl_t pitch               = 0.;
 aubio_pitchdetection_t * pitchdet;
-aubio_pitchdetection_type type_pitch = aubio_pitch_schmitt; // aubio_pitch_mcomb
+aubio_pitchdetection_type type_pitch = aubio_pitch_yinfft; // aubio_pitch_mcomb
 aubio_pitchdetection_mode mode_pitch = aubio_pitchm_freq;
 uint_t median         = 6;
 
@@ -182,6 +182,8 @@
                         case 'p':
                                 if (strcmp(optarg,"mcomb") == 0) 
                                         type_pitch = aubio_pitch_mcomb;
+                                else if (strcmp(optarg,"yinfft") == 0) 
+                                        type_pitch = aubio_pitch_yin;
                                 else if (strcmp(optarg,"yin") == 0) 
                                         type_pitch = aubio_pitch_yin;
                                 else if (strcmp(optarg,"schmitt") == 0) 
@@ -264,12 +266,13 @@
 
   if (usepitch) {
     pitchdet = new_aubio_pitchdetection(buffer_size*4, 
-                    overlap_size, channels, samplerate, type_pitch, mode_pitch);
-  
-  if (median) {
-          note_buffer = new_fvec(median, 1);
-          note_buffer2= new_fvec(median, 1);
-  }
+        overlap_size, channels, samplerate, type_pitch, mode_pitch);
+    aubio_pitchdetection_set_yinthresh(pitchdet, 0.7);
+
+    if (median) {
+      note_buffer = new_fvec(median, 1);
+      note_buffer2= new_fvec(median, 1);
+    }
   }
   /* phase vocoder */
   pv = new_aubio_pvoc(buffer_size, overlap_size, channels);