Csound Csound-dev Csound-tekno Search About

[Cs-dev] Using pvoc file handling functions in the API

Date2013-01-31 16:03
FromEdward Costello
Subject[Cs-dev] Using pvoc file handling functions in the API
AttachmentsNone  None  
Hey,

I was looking through the API and found the following functions:

const char *pvoc_errorstr(CSOUND *);
int     init_pvsys(CSOUND *);
int     pvoc_createfile(CSOUND *, const char *,
                        uint32, uint32, uint32,
                        uint32, int32, int, int,
                        float, float *, uint32);
int     pvoc_openfile(CSOUND *,
                      const char *filename, PVOCDATA *data, WAVEFORMATEX *fmt);
int     pvoc_closefile(CSOUND *, int);
int     pvoc_putframes(CSOUND *,
                       int ofd, const float *frame, int32 numframes);
int     pvoc_getframes(CSOUND *,
                       int ifd, float *frames, uint32 nframes);
int     pvoc_framecount(CSOUND *, int ifd);
int     pvoc_fseek(CSOUND *, int ifd, int offset);
int     pvsys_release(CSOUND *);

Are these used by PVANAL to make .pvx files? Also I was wondering how one uses these functions directly to create a .pvx file from a wav file. I can't find where the arguments for these functions are documented.
Thanks
Ed

Date2013-01-31 17:31
FromSteven Yi
SubjectRe: [Cs-dev] Using pvoc file handling functions in the API
Hi Ed,

Looks like most of the function implementations are in
OOps/pvfileio.c.  The source for pvanal is in the util folder.  I
haven't looked at that code so can't comment further! :)

Cheers!
steven

On Thu, Jan 31, 2013 at 4:03 PM, Edward Costello
 wrote:
> Hey,
>
> I was looking through the API and found the following functions:
>
> const char *pvoc_errorstr(CSOUND *);
> int     init_pvsys(CSOUND *);
> int     pvoc_createfile(CSOUND *, const char *,
>                         uint32, uint32, uint32,
>                         uint32, int32, int, int,
>                         float, float *, uint32);
> int     pvoc_openfile(CSOUND *,
>                       const char *filename, PVOCDATA *data, WAVEFORMATEX
> *fmt);
> int     pvoc_closefile(CSOUND *, int);
> int     pvoc_putframes(CSOUND *,
>                        int ofd, const float *frame, int32 numframes);
> int     pvoc_getframes(CSOUND *,
>                        int ifd, float *frames, uint32 nframes);
> int     pvoc_framecount(CSOUND *, int ifd);
> int     pvoc_fseek(CSOUND *, int ifd, int offset);
> int     pvsys_release(CSOUND *);
>
> Are these used by PVANAL to make .pvx files? Also I was wondering how one
> uses these functions directly to create a .pvx file from a wav file. I can't
> find where the arguments for these functions are documented.
> Thanks
> Ed
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_jan
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-01-31 17:42
FromVictor Lazzarini
SubjectRe: [Cs-dev] Using pvoc file handling functions in the API
AttachmentsNone  None  
They are not part of the public API (csound.h). 
They can be used in opcodes though. Look in Opcodes/pvsbasic.c and OOps/pstream.c for examples, and
OOps/pvfileio.c for their implementation.

They are also used in Util/pvanal.c

Victor
On 31 Jan 2013, at 16:03, Edward Costello wrote:

Hey,

I was looking through the API and found the following functions:

const char *pvoc_errorstr(CSOUND *);
int     init_pvsys(CSOUND *);
int     pvoc_createfile(CSOUND *, const char *,
                        uint32, uint32, uint32,
                        uint32, int32, int, int,
                        float, float *, uint32);
int     pvoc_openfile(CSOUND *,
                      const char *filename, PVOCDATA *data, WAVEFORMATEX *fmt);
int     pvoc_closefile(CSOUND *, int);
int     pvoc_putframes(CSOUND *,
                       int ofd, const float *frame, int32 numframes);
int     pvoc_getframes(CSOUND *,
                       int ifd, float *frames, uint32 nframes);
int     pvoc_framecount(CSOUND *, int ifd);
int     pvoc_fseek(CSOUND *, int ifd, int offset);
int     pvsys_release(CSOUND *);

Are these used by PVANAL to make .pvx files? Also I was wondering how one uses these functions directly to create a .pvx file from a wav file. I can't find where the arguments for these functions are documented.
Thanks
Ed
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




Date2013-01-31 18:18
FromMichael Gogins
SubjectRe: [Cs-dev] Using pvoc file handling functions in the API
You can use nm, pexports, dumpbin, or some similar utility to
determine if, and where, these functions are exported (i.e., made
available to be linked with by some external software).

If so, then you can declare the types of these functions as 'extern'
in your code, e.g. 'extern int myfunct(const char* mystring, double
mydouble);' You don't actually need a header file, a header file just
make this procedure safer and more convenient.

You can then call these functions in your code. Of course you will
need to link with the object file, static library, or shared library
that actually defines these functions.

Regards,
Mike

On Thu, Jan 31, 2013 at 12:42 PM, Victor Lazzarini
 wrote:
> They are not part of the public API (csound.h).
> They can be used in opcodes though. Look in Opcodes/pvsbasic.c and
> OOps/pstream.c for examples, and
> OOps/pvfileio.c for their implementation.
>
> They are also used in Util/pvanal.c
>
> Victor
> On 31 Jan 2013, at 16:03, Edward Costello wrote:
>
> Hey,
>
> I was looking through the API and found the following functions:
>
> const char *pvoc_errorstr(CSOUND *);
> int     init_pvsys(CSOUND *);
> int     pvoc_createfile(CSOUND *, const char *,
>                         uint32, uint32, uint32,
>                         uint32, int32, int, int,
>                         float, float *, uint32);
> int     pvoc_openfile(CSOUND *,
>                       const char *filename, PVOCDATA *data, WAVEFORMATEX
> *fmt);
> int     pvoc_closefile(CSOUND *, int);
> int     pvoc_putframes(CSOUND *,
>                        int ofd, const float *frame, int32 numframes);
> int     pvoc_getframes(CSOUND *,
>                        int ifd, float *frames, uint32 nframes);
> int     pvoc_framecount(CSOUND *, int ifd);
> int     pvoc_fseek(CSOUND *, int ifd, int offset);
> int     pvsys_release(CSOUND *);
>
> Are these used by PVANAL to make .pvx files? Also I was wondering how one
> uses these functions directly to create a .pvx file from a wav file. I can't
> find where the arguments for these functions are documented.
> Thanks
> Ed
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_jan_______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> NUI Maynooth Ireland
> tel.: +353 1 708 3545
> Victor dot Lazzarini AT nuim dot ie
>
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_jan
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>



-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-01-31 18:46
FromEdward Costello
SubjectRe: [Cs-dev] Using pvoc file handling functions in the API
AttachmentsNone  None  
Thanks for the info, yeah I reckon then the most straightforward way to get .pvx files is to just use the pvanal program with system() or something, I was originally reading files into a pvsbuffer using a UDO, but found that to be quite slow in my program.
Cheers,
Ed


On 31 Jan 2013, at 17:03, Edward Costello <edwardcostello@gmail.com> wrote:

Hey,

I was looking through the API and found the following functions:

const char *pvoc_errorstr(CSOUND *);
int     init_pvsys(CSOUND *);
int     pvoc_createfile(CSOUND *, const char *,
                        uint32, uint32, uint32,
                        uint32, int32, int, int,
                        float, float *, uint32);
int     pvoc_openfile(CSOUND *,
                      const char *filename, PVOCDATA *data, WAVEFORMATEX *fmt);
int     pvoc_closefile(CSOUND *, int);
int     pvoc_putframes(CSOUND *,
                       int ofd, const float *frame, int32 numframes);
int     pvoc_getframes(CSOUND *,
                       int ifd, float *frames, uint32 nframes);
int     pvoc_framecount(CSOUND *, int ifd);
int     pvoc_fseek(CSOUND *, int ifd, int offset);
int     pvsys_release(CSOUND *);

Are these used by PVANAL to make .pvx files? Also I was wondering how one uses these functions directly to create a .pvx file from a wav file. I can't find where the arguments for these functions are documented.
Thanks
Ed


Date2013-01-31 18:49
FromVictor Lazzarini
SubjectRe: [Cs-dev] Using pvoc file handling functions in the API
AttachmentsNone  None  
you can write an opcode to replace your UDO. Check out the code for pvsfread in pstream.c

Victor
On 31 Jan 2013, at 18:46, Edward Costello wrote:

Thanks for the info, yeah I reckon then the most straightforward way to get .pvx files is to just use the pvanal program with system() or something, I was originally reading files into a pvsbuffer using a UDO, but found that to be quite slow in my program.
Cheers,
Ed


On 31 Jan 2013, at 17:03, Edward Costello <edwardcostello@gmail.com> wrote:

Hey,

I was looking through the API and found the following functions:

const char *pvoc_errorstr(CSOUND *);
int     init_pvsys(CSOUND *);
int     pvoc_createfile(CSOUND *, const char *,
                        uint32, uint32, uint32,
                        uint32, int32, int, int,
                        float, float *, uint32);
int     pvoc_openfile(CSOUND *,
                      const char *filename, PVOCDATA *data, WAVEFORMATEX *fmt);
int     pvoc_closefile(CSOUND *, int);
int     pvoc_putframes(CSOUND *,
                       int ofd, const float *frame, int32 numframes);
int     pvoc_getframes(CSOUND *,
                       int ifd, float *frames, uint32 nframes);
int     pvoc_framecount(CSOUND *, int ifd);
int     pvoc_fseek(CSOUND *, int ifd, int offset);
int     pvsys_release(CSOUND *);

Are these used by PVANAL to make .pvx files? Also I was wondering how one uses these functions directly to create a .pvx file from a wav file. I can't find where the arguments for these functions are documented.
Thanks
Ed

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




Date2013-01-31 19:17
FromEdward Costello
SubjectRe: [Cs-dev] Using pvoc file handling functions in the API
AttachmentsNone  None  
Just checked it out there and it looks like it will be easy enough to get an opcode together. 
I was just wondering when the pvoc does it's analysis how it reads the first few frames, if I'm analysing at an FFT frame size of 1024, and a hop of 256, with hann windowing, does the first frame contain 756 zeros then the first 256 samples of the wav file? Or is it 512 and 512, or does it read in a whole frame of samples?

On 31 Jan 2013, at 19:49, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:

you can write an opcode to replace your UDO. Check out the code for pvsfread in pstream.c

Victor
On 31 Jan 2013, at 18:46, Edward Costello wrote:

Thanks for the info, yeah I reckon then the most straightforward way to get .pvx files is to just use the pvanal program with system() or something, I was originally reading files into a pvsbuffer using a UDO, but found that to be quite slow in my program.
Cheers,
Ed


On 31 Jan 2013, at 17:03, Edward Costello <edwardcostello@gmail.com> wrote:

Hey,

I was looking through the API and found the following functions:

const char *pvoc_errorstr(CSOUND *);
int     init_pvsys(CSOUND *);
int     pvoc_createfile(CSOUND *, const char *,
                        uint32, uint32, uint32,
                        uint32, int32, int, int,
                        float, float *, uint32);
int     pvoc_openfile(CSOUND *,
                      const char *filename, PVOCDATA *data, WAVEFORMATEX *fmt);
int     pvoc_closefile(CSOUND *, int);
int     pvoc_putframes(CSOUND *,
                       int ofd, const float *frame, int32 numframes);
int     pvoc_getframes(CSOUND *,
                       int ifd, float *frames, uint32 nframes);
int     pvoc_framecount(CSOUND *, int ifd);
int     pvoc_fseek(CSOUND *, int ifd, int offset);
int     pvsys_release(CSOUND *);

Are these used by PVANAL to make .pvx files? Also I was wondering how one uses these functions directly to create a .pvx file from a wav file. I can't find where the arguments for these functions are documented.
Thanks
Ed

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie



------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel