Pvanal header file io - finding strange long integers in the header

Hey CSounders,
I am trying to use a .pvx file created by pvanal to do some analysis in c++, but when reading the header, I am getting values different than the ones advertised. For example, when I try to look up the first two values of the header (which should in theory be 517730 for the value magie (a magic number) and 56 for headBsize (the header size)), I get 1380533760 and 1185205760 respectively. This leads me to believe that either the header is in a format different than what is listed on this website:

http://www.ee.columbia.edu/~dpwe/resources/pvanal.html

or that there is a subtlety about the file that I am not getting. I am fairly confident, though, that the c++ code below is correct (meaning that it is in fact reading bytes 0-3 into a long integer followed by bytes 4-7 into another long integer) - I have used code similar to this for a fair bit of I/O and it works fine. Thanks!!

#include "iostream"
#include "iomanip"
#include "fstream"

using namespace std;

int main()
{
ifstream infile;
ifstream testfile;
char *inname = "/Users/mikesolomon/Mikka.pvx";

long magie;
long headBsize;
infile.open(inname, ios::binary);

infile.get((char *)&magie, sizeof(long));
infile.get((char *)&headBsize, sizeof(long));
cout << "Successfully read values from the file." << endl;
cout << "magie :" << magie << endl;
cout << "headBsize :" << headBsize << endl;

infile.close();
return 0;
}

Definitely not as advertised!

I thought I'd quickly see if I could verify your problems, and I sure did! Nothing [I mean nothing] seems to be correct.

I thought I'd run pvanal (Linux, Csound 4.23) on the mary.wav file that I think comes with the examples, so I did:

pvanal mary.wav mary.pvx

and got an immediate segmentation fault! Tried several variants (converting to AIFF, adding options) with no effect. Then tried:

csound -U pvanal mary.wav mary.pvx

which seemed to work -- generated a large pvx file anyway.

However, you're right -- the header of that file bears no relation to the form described in the reference you give (or to the "pvoc.h" headed included with Csound itself).
In fact I did a dump ("od -c mary.pvx") and the beginning of the file is a RIFF header!! Looks actually quite like the head of the original file, but it quickly diverges.

According to my calculations, that magic number 517730 translates to hex bytes 07 e6 62 (or 62 e6 07 little endian) so I scanned for that (both ways) in a hex-byte version of the dump. Not a trace!

As a capper, I decided to check the pvx file with the "pvlook" utility. It reports "Not a pvoc file"! Sigh.

Obviously this needs to be sorted out -- by someone....

AArghhh!!

It is *really* time that somebody took the Csound documenters to a remedial writing course (:-/). I just re-read the page on pvanal, and realized that as usual they start in the middle and work sideways -- forgetting what might be important to a newcomer.

You do *not* want to use the extension '.pvx'! The docs do happen to say that if you want to create a "PVOC-EX" file you should use that extension. They omit the slightly important point that if you want a file that can actually by *interpreted* by anything else, you should *not* use that extension!! (I have no idea what a PVOC-EX file is, and at the moment am not motivated.)

Change the output file extension to ".pvoc" or something, and you get the format you expect, with that magic header, header-size and so on. (Though I still get a core-dump if I try to run pvanal directly.)

Sigh, again...

z pack viagra online buy viagra uk cheap generic viagra generic cialis ed drugs buy zithromax zpack Canadian pharmacy viagra zpak Canadian pharmacy z-pack z pak cialis uk z-pak staxyn avanafil generic viagra kamagra uk ed pills pharmacy uk cialis online viagra uk