shithub: aubio

Download patch

ref: 1f403595a4c3996619093a37a74c54ffd3f142a8
parent: a4b089c6106093aadfc27d0e8a68761305e83838
author: Paul Brossier <piem@altern.org>
date: Tue Mar 29 21:53:46 EST 2005

fix jack playing with short buffer (move pos) 
        (aubionotes.c and aubioonset.c)
        added samplerate query to aubioonset.c

--- a/examples/aubionotes.c
+++ b/examples/aubionotes.c
@@ -72,6 +72,8 @@
 aubio_midi_driver_t * mdriver; 
 aubio_midi_event_t  * event;
 
+unsigned int pos = 0; /*frames%dspblocksize*/
+
 void send_noteon(aubio_midi_driver_t * d, int pitch, int velo);
 void send_noteon(aubio_midi_driver_t * d, int pitch, int velo)
 {
@@ -102,7 +104,6 @@
 int aubio_process(float **input, float **output, int nframes) {
   unsigned int i;       /*channels*/
   unsigned int j;       /*frames*/
-  unsigned int pos = 0; /*frames%dspblocksize*/
   for (j=0;j<nframes;j++) {
     if(usejack) {
       for (i=0;i<channels;i++) {
--- a/examples/aubioonset.c
+++ b/examples/aubioonset.c
@@ -59,11 +59,11 @@
 fvec_t *onset2;
 int isonset = 0;
 aubio_pickpeak_t * parms;
+unsigned int pos = 0; /*frames%dspblocksize*/
 
 int aubio_process(float **input, float **output, int nframes) {
   unsigned int i;       /*channels*/
   unsigned int j;       /*frames*/
-  unsigned int pos = 0; /*frames%dspblocksize*/
   for (j=0;j<nframes;j++) {
     if(usejack) {
       for (i=0;i<channels;i++) {
@@ -119,6 +119,7 @@
     file = new_file_ro (input_filename);
     if (verbose) file_info(file);
     channels = aubio_file_channels(file);
+    samplerate = aubio_file_samplerate(file);
     if (output_filename != NULL)
       fileout = new_file_wo(file, output_filename);
   }