[Cs-dev] Using pvoc file handling functions in the API
Date | 2013-01-31 16:03 |
From | Edward Costello |
Subject | [Cs-dev] Using pvoc file handling functions in the API |
Attachments | None 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 |
Date | 2013-01-31 17:31 |
From | Steven Yi |
Subject | Re: [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 |
Date | 2013-01-31 17:42 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] Using pvoc file handling functions in the API |
Attachments | None 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:
Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |
Date | 2013-01-31 18:18 |
From | Michael Gogins |
Subject | Re: [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 |
Date | 2013-01-31 18:46 |
From | Edward Costello |
Subject | Re: [Cs-dev] Using pvoc file handling functions in the API |
Attachments | None 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:
|
Date | 2013-01-31 18:49 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] Using pvoc file handling functions in the API |
Attachments | None None |
you can write an opcode to replace your UDO. Check out the code for pvsfread in pstream.c On 31 Jan 2013, at 18:46, Edward Costello wrote:
Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |
Date | 2013-01-31 19:17 |
From | Edward Costello |
Subject | Re: [Cs-dev] Using pvoc file handling functions in the API |
Attachments | None 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:
|