Csound Csound-dev Csound-tekno Search About

[Cs-dev] Regarding a couple of messages during usage

Date2005-04-06 07:32
FromSteven Yi
Subject[Cs-dev] Regarding a couple of messages during usage
Hi All,

I noticed that I get a lot of the following messages when running CS5:

Allocating 262436 bytes
ftable 101:
Allocating 262436 bytes
ftable 102:
...

And it seems to be from the following code in fgens.c:


  if ((ftp = csound->flist[ff->fno]) == NULL) {   /*   alloc space as reqd */
      printf("Allocating %ld bytes\n",
             (long)sizeof(FUNC) + ff->flen*sizeof(MYFLT));
      ftp = (FUNC *) mcalloc(csound, (long)sizeof(FUNC) +
ff->flen*sizeof(MYFLT));
      csound->flist[ff->fno] = ftp;

Just wondering what the purpose of the printf is, I'm assuming someone
put it there for debugging but never took it out?  If not supposed to
be out, should it be changed to csound->Message() ?

Also, I'm getting:

WARNING: FFT2torlpacked() is deprecated. Use csoundInverseRealFFT() instead.

I'm assuming this means some code is calling FFT2torlpacked() and this
code should be revised to use csoundInverseRealFFT.  I think this is
coming from oscbnk.c for vco2.  Any particular reason FFT2torlpacked
is still in use?

Thanks,
steven


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-04-06 11:41
FromIstvan Varga
SubjectRe: [Cs-dev] Regarding a couple of messages during usage
Steven Yi wrote:

> Just wondering what the purpose of the printf is, I'm assuming someone
> put it there for debugging but never took it out?

I do not think this message is particularly useful, so it can be safely
removed, or printed only if #ifdef BETA or #ifdef DEBUG or similar are set.
I will probably change it now to print the message only if the -v command
line flag is used.

> If not supposed to be out, should it be changed to csound->Message() ?

Yes. Csound is intended to be used as a library, and should generally
use csound->Message() to print messages, rather than printf, err_printf
or other functions that print to stdout or stderr. There are some places
where a *csound pointer is not available, making it problematic to use
csoundMessage, but this is obviously not the case in fgens.c.
I already replaced printf with csound->Message in most plugin opcodes in
Opcodes/.

> I'm assuming this means some code is calling FFT2torlpacked() and this
> code should be revised to use csoundInverseRealFFT.  I think this is
> coming from oscbnk.c for vco2.  Any particular reason FFT2torlpacked
> is still in use?

FFT2realpacked and FFT2torlpacked are used in many files, but these
functions are now only frontends to csound->RealFFT() and
csound->InverseRealFFT(). These calls will eventually be replaced as
suggested by the warnings, and then removed from the API (the files
OOps/fft.c and H/fft.h can also be removed once the old functions are
no longer in use).

Here is the list of uses of the deprecated FFT functions:

./Engine/fgens.c:    FFT2realpacked (x, l2, NULL);
./Engine/fgens.c:    FFT2torlpacked (x, l1, FL(1.0) / (MYFLT)l2, NULL);
./Engine/fgens.c:    FFT2realpacked (x, l2, NULL);
./Engine/fgens.c:    FFT2torlpacked (y, l1, FL(1.0) / (MYFLT) l2, NULL);
./Engine/fgens.c:          FFT2realpacked (x, l2, NULL);
./Engine/fgens.c:      FFT2torlpacked (y, l1, FL(1.0), NULL);
./Engine/fgens.c:    FFT2torlpacked(x, flen, FL(0.5), NULL);    /* iFFT */
./Engine/oload.c:        FFT2torlpacked,
./Engine/oload.c:        FFT2realpacked,
./H/csoundCore.h:    void (*FFT2torlpacked_)(complex *, long, MYFLT, complex *);
./H/csoundCore.h:    void (*FFT2realpacked_)(complex *, long, complex *);
./H/fft.h:void FFT2torlpacked(complex *, long, MYFLT, complex *);
./H/fft.h:void FFT2realpacked(complex *, long, complex *);
./OOps/ugens9.c:        csound->FFT2realpacked_((complex *)p->fftbuf,Hlenpadded,
./OOps/ugens9.c:          csound->FFT2torlpacked_((complex*)(p->fftbuf),Hlenpadded,
./OOps/ugens9.c:        csound->FFT2realpacked_((complex *)IRblock, 
p->Hlenpadded, NULL);
./OOps/ugens9.c:        csound->FFT2realpacked_(workBuf, p->Hlenpadded, NULL);
./OOps/ugens9.c:          csound->FFT2torlpacked_((complex *)(buf + 
i*hlenpaddedplus2),
./OOps/disprep.c:    FFT2realpacked((complex *)dst,size,(complex *)NULL); /* 
perform the FFT */
./OOps/fft.c:    FFT2realpacked: Radix-2 FFT, with real data assumed, and 
accepts packed
./OOps/fft.c:    FFT2torlpacked: Converse of FFTrealpacked
./OOps/fft.c:    "FFT2torlpacked() is deprecated. Use csoundInverseRealFFT() 
instead.\n",
./OOps/fft.c:    "FFT2realpacked() is deprecated. Use csoundRealFFT() instead.\n",
./OOps/fft.c:void FFT2torlpacked(complex x_[], long n, MYFLT scale, complex ex[])
./OOps/fft.c:void FFT2realpacked(complex x_[], long n, complex ex[])
./OOps/pvinterp.c:    FFT2torlpacked((complex *)buf, size, p->scale, (complex 
*)NULL);
./OOps/pvinterp.c:    FFT2torlpacked((complex *)buf, size, p->scale, (complex 
*)NULL);
./OOps/ugens8.c:    FFT2torlpacked((complex *) buf, size, p->scale, (complex *) 
NULL);
./OOps/vpvoc.c:      FFT2torlpacked((complex *)buf, size, p->scale, (complex 
*)NULL);
./Opcodes/oscbnk.c:    csound->FFT2torlpacked_(fftbuf, (long) table->size, 
FL(0.5), NULL);
./Opcodes/oscbnk.c:        csound->FFT2realpacked_(tp.w_fftbuf, ftp->flen, NULL);
./Top/cvanal.c:      FFT2realpacked((complex *)outbuf, Hlenpadded, NULL);
./Top/pvanal.c:      FFT2realpacked((complex *)tmpBuf, frameSize, NULL);
./Engine/oload.c:        cxmult,
./H/csoundCore.h:    void (*cxmult_)(complex *,complex *,long);
./H/fft.h:void cxmult(complex *,complex *,long);
./OOps/ugens9.c:          csound->cxmult_((complex *)(p->H+chn*(Hlenpadded+2)),
./OOps/fft.c:    "cxmult() is deprecated. Use csoundRealFFTMult() instead.\n"
./OOps/fft.c:void cxmult(complex *a, complex *b, long n)


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-04-06 16:31
FromSteven Yi
SubjectRe: [Cs-dev] Regarding a couple of messages during usage
Hi Istvan,

Thanks for the info!

steven

On Apr 6, 2005 3:41 AM, Istvan Varga  wrote:
> Steven Yi wrote:
> 
> > Just wondering what the purpose of the printf is, I'm assuming someone
> > put it there for debugging but never took it out?
> 
> I do not think this message is particularly useful, so it can be safely
> removed, or printed only if #ifdef BETA or #ifdef DEBUG or similar are set.
> I will probably change it now to print the message only if the -v command
> line flag is used.
> 
> > If not supposed to be out, should it be changed to csound->Message() ?
> 
> Yes. Csound is intended to be used as a library, and should generally
> use csound->Message() to print messages, rather than printf, err_printf
> or other functions that print to stdout or stderr. There are some places
> where a *csound pointer is not available, making it problematic to use
> csoundMessage, but this is obviously not the case in fgens.c.
> I already replaced printf with csound->Message in most plugin opcodes in
> Opcodes/.
> 
> > I'm assuming this means some code is calling FFT2torlpacked() and this
> > code should be revised to use csoundInverseRealFFT.  I think this is
> > coming from oscbnk.c for vco2.  Any particular reason FFT2torlpacked
> > is still in use?
> 
> FFT2realpacked and FFT2torlpacked are used in many files, but these
> functions are now only frontends to csound->RealFFT() and
> csound->InverseRealFFT(). These calls will eventually be replaced as
> suggested by the warnings, and then removed from the API (the files
> OOps/fft.c and H/fft.h can also be removed once the old functions are
> no longer in use).
> 
> Here is the list of uses of the deprecated FFT functions:
> 
> ./Engine/fgens.c:    FFT2realpacked (x, l2, NULL);
> ./Engine/fgens.c:    FFT2torlpacked (x, l1, FL(1.0) / (MYFLT)l2, NULL);
> ./Engine/fgens.c:    FFT2realpacked (x, l2, NULL);
> ./Engine/fgens.c:    FFT2torlpacked (y, l1, FL(1.0) / (MYFLT) l2, NULL);
> ./Engine/fgens.c:          FFT2realpacked (x, l2, NULL);
> ./Engine/fgens.c:      FFT2torlpacked (y, l1, FL(1.0), NULL);
> ./Engine/fgens.c:    FFT2torlpacked(x, flen, FL(0.5), NULL);    /* iFFT */
> ./Engine/oload.c:        FFT2torlpacked,
> ./Engine/oload.c:        FFT2realpacked,
> ./H/csoundCore.h:    void (*FFT2torlpacked_)(complex *, long, MYFLT, complex *);
> ./H/csoundCore.h:    void (*FFT2realpacked_)(complex *, long, complex *);
> ./H/fft.h:void FFT2torlpacked(complex *, long, MYFLT, complex *);
> ./H/fft.h:void FFT2realpacked(complex *, long, complex *);
> ./OOps/ugens9.c:        csound->FFT2realpacked_((complex *)p->fftbuf,Hlenpadded,
> ./OOps/ugens9.c:          csound->FFT2torlpacked_((complex*)(p->fftbuf),Hlenpadded,
> ./OOps/ugens9.c:        csound->FFT2realpacked_((complex *)IRblock,
> p->Hlenpadded, NULL);
> ./OOps/ugens9.c:        csound->FFT2realpacked_(workBuf, p->Hlenpadded, NULL);
> ./OOps/ugens9.c:          csound->FFT2torlpacked_((complex *)(buf +
> i*hlenpaddedplus2),
> ./OOps/disprep.c:    FFT2realpacked((complex *)dst,size,(complex *)NULL); /*
> perform the FFT */
> ./OOps/fft.c:    FFT2realpacked: Radix-2 FFT, with real data assumed, and
> accepts packed
> ./OOps/fft.c:    FFT2torlpacked: Converse of FFTrealpacked
> ./OOps/fft.c:    "FFT2torlpacked() is deprecated. Use csoundInverseRealFFT()
> instead.\n",
> ./OOps/fft.c:    "FFT2realpacked() is deprecated. Use csoundRealFFT() instead.\n",
> ./OOps/fft.c:void FFT2torlpacked(complex x_[], long n, MYFLT scale, complex ex[])
> ./OOps/fft.c:void FFT2realpacked(complex x_[], long n, complex ex[])
> ./OOps/pvinterp.c:    FFT2torlpacked((complex *)buf, size, p->scale, (complex
> *)NULL);
> ./OOps/pvinterp.c:    FFT2torlpacked((complex *)buf, size, p->scale, (complex
> *)NULL);
> ./OOps/ugens8.c:    FFT2torlpacked((complex *) buf, size, p->scale, (complex *)
> NULL);
> ./OOps/vpvoc.c:      FFT2torlpacked((complex *)buf, size, p->scale, (complex
> *)NULL);
> ./Opcodes/oscbnk.c:    csound->FFT2torlpacked_(fftbuf, (long) table->size,
> FL(0.5), NULL);
> ./Opcodes/oscbnk.c:        csound->FFT2realpacked_(tp.w_fftbuf, ftp->flen, NULL);
> ./Top/cvanal.c:      FFT2realpacked((complex *)outbuf, Hlenpadded, NULL);
> ./Top/pvanal.c:      FFT2realpacked((complex *)tmpBuf, frameSize, NULL);
> ./Engine/oload.c:        cxmult,
> ./H/csoundCore.h:    void (*cxmult_)(complex *,complex *,long);
> ./H/fft.h:void cxmult(complex *,complex *,long);
> ./OOps/ugens9.c:          csound->cxmult_((complex *)(p->H+chn*(Hlenpadded+2)),
> ./OOps/fft.c:    "cxmult() is deprecated. Use csoundRealFFTMult() instead.\n"
> ./OOps/fft.c:void cxmult(complex *a, complex *b, long n)
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net