| Depends on whether you are writing text or binary.
>From Opcodes/ftgen.s function ftsave
BINARY
FUNC *ftp;
//csound->Message(csound, "saving table %f \n", **argp);
if ( *argp && (ftp = ft_func(csound, *argp)) != NULL) {
MYFLT *table = ftp->ftable;
int32 flen = ftp->flen;
int32_t n;
n = fwrite(ftp, sizeof(FUNC) - sizeof(MYFLT) - SSTRSIZ, 1,
file);
if (UNLIKELY(n!=1)) goto err4;
n = fwrite(table, sizeof(MYFLT), flen + 1, file);
if (UNLIKELY(n!=flen + 1)) goto err4;
}
else goto err;
TEXT
FUNC *ftp;
if ((ftp = ft_func(csound, *argp)) != NULL) {
int32 flen = ftp->flen;
int32 j;
MYFLT *table = ftp->ftable;
/* IMPORTANT!! If FUNC structure and/or GEN01ARGS structure
will be modified, the following code has to be modified too
*/
fprintf(file,"======= TABLE %d size: %d values ======\n",
ftp->fno, ftp->flen);
fprintf(file,"flen: %d\n", ftp->flen);
fprintf(file,"lenmask: %d\n", ftp->lenmask);
fprintf(file,"lobits: %d\n",ftp->lobits);
fprintf(file,"lomask: %d\n",ftp->lomask);
fprintf(file,"lodiv: %f\n",ftp->lodiv);
fprintf(file,"cvtbas: %f\n",ftp->cvtbas);
fprintf(file,"cpscvt: %f\n",ftp->cpscvt);
fprintf(file,"loopmode1: %d\n", (int32_t) ftp->loopmode1);
fprintf(file,"loopmode2: %d\n", (int32_t) ftp->loopmode2);
fprintf(file,"begin1: %d\n",ftp->begin1);
fprintf(file,"end1: %d\n",ftp->end1);
fprintf(file,"begin2: %d\n",ftp->begin2);
fprintf(file,"end2: %d\n",ftp->end2);
fprintf(file,"soundend: %d\n",ftp->soundend);
fprintf(file,"flenfrms: %d\n",ftp->flenfrms);
fprintf(file,"nchnls: %d\n",ftp->nchanls);
fprintf(file,"fno: %d\n",ftp->fno);
fprintf(file,"gen01args.gen01: %f\n",ftp->gen01args.gen01);
fprintf(file,"gen01args.ifilno: %f\n",ftp->gen01args.ifilno);
fprintf(file,"gen01args.iskptim: %f\n",ftp->gen01args.iskptim);
fprintf(file,"gen01args.iformat: %f\n",ftp->gen01args.iformat);
fprintf(file,"gen01args.channel: %f\n",ftp->gen01args.channel);
fprintf(file,"gen01args.sample_rate: %f\n",
ftp->gen01args.sample_rate);
/* WARNING! skips ftp->gen01args.strarg from saving/loading in
text format */
fprintf(file,"---------END OF HEADER--------------\n");
No guaranty that this may not change. I think that &%f shoud be %a for
example
On Wed, 12 May 2021, Jeanette C. wrote:
> Hey hey,
> I'm working on a small conversion tool between different formats and I'd like
> to write Csound tables ready for ftload(k) as well. Is there a simple
> documentation on the header format? I can' understand quite a few bits, but
> others I'm completely unclear about.
>
> If it helps I want to write a single one-channel table, no extras at all. No
> guard points, loops or CPS information.
>
> I'd be grateful for any pointer.
>
> Best wishes and thanks,
>
> Jeanette
>
> --
> * Website: http://juliencoder.de - for summer is a state of sound
> * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
> * Audiobombs: https://www.audiobombs.com/users/jeanette_c
> * GitHub: https://github.com/jeanette-c
>
> If only I could trade the fancy cars
> For a chance today,
> it's incomparable <3
> (Britney Spears)
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
> https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here |