Error in pitchschmitt.c

Paul Brossier piem at piem.org
Tue Apr 1 00:25:04 CEST 2008


hi again,

On Tue, Mar 18, 2008 at 08:44:40AM -0700, Paul Dean wrote:
> I'm working on getting AUBIO to compile on my VS2005 compiler. I run
> into an error I have a question about.
> 
> In the aubio_pitchschmitt_detect() function, an array is declared with
> an un-initiated size because we don't know what size input->length is.

thanks, not something gcc ever complained about, but not something to do
either!

> Does input->length's value change during run-time or is it static? If
> it's dynamic, we may have to use a vector here. 

you mean a c++ vector? i'd rather not use them in C :-)

the fvec buf does have a fixed size, and should really be moved in the
private structure of pitchschmitt. i opened a ticket and will get this
fixed it for the next release:

        http://trac.aubio.org/ticket/8

as for the other problem about isnan, it sounds more like a linker
warning. maybe you are missing a library, or a header?

let us know if you find out more.

thanks, Paul

> 
>  
> 
>  
> 
> ***** pitchschmitt.c ******
> 
> .
> 
> .
> 
> .
> 
>  
> 
> smpl_t aubio_pitchschmitt_detect (aubio_pitchschmitt_t *p, fvec_t *
> input)
> 
> {
> 
>   short buf[input->length];      <---- Compiler Error: cannot allocate
> an array of unknown size.
> 
>   uint_t i;
> 
>   for (i=0; i<input->length; i++) {
> 
>     buf[i] = (short)(input->data[0][i]*32768.);
> 
>   }
> 
>   return aubio_schmittS16LE(p, input->length, buf);
> 
> }
> 
> .
> 
> .
> 
> .
> 
>  
> 
>  
> 
>  
> 
>  
> 
> Also.. in onsetdetection.c in the aubio_onsetdetection_kl() function,
> this line give me a warning I'm not sure what to do with.
> 
>  
> 
> ******* onsetdetection.c *********
> 
> .
> 
> .
> 
> .
> 
> if (isnan(onset->data[i][0])) onset->data[i][0] = 0.;   <---- Comiler
> Warning: 'isnan' undefined; assuming extern returning int.
> 
> .
> 
> .
> 
> .
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> -aquawicket
> 
>  
> 
> P.S. I was able to get AUBIO to comple in VS2005 with the
> aubio_pitchschmitt_detect() function commented out. 
> 
>      I'm using test-onsetdetection.c to create the executable. I'll test
> it's functionality to see that everything works.
> 
>      Then I'll post a VS2005 Project along with a CMAKE script soon :-)
> 


-- 
To unsubscribe, send mail to aubio-unsubscribe at piem.org.




More information about the aubio-user mailing list