Writing a GEN plugin (64 bit) Hi, After reading Victor’s tutorial: http://csounds.com/articles/Extensions_to_Csound.pdf and building the example under 3.3.2 "plugin function tables", csound tells m

Hi,

After reading Victor’s tutorial:
http://csounds.com/articles/Extensions_to_Csound.pdf
and building the example under 3.3.2 “plugin function tables”,
csound tells me that the GEN number 44 is unknown (see test.csd below).
Is there a way of getting feedback when a GEN plugin was loaded and
which number it has?
The tutorial says that there are 43 internal GEN routines and GEN
plugins are numbered according to their loading order but according to
the manual the highest GEN number is 52. I tried out 53 but that didn’t
work either.
I am sure that the new shared library is in the right place.

Georg

C code and test.csd as follows:

///////////////// GEN plugin ///////////////////////////
#define USE_DOUBLE 1
#include “csdl.h”
#include <math.h>
void tanhtable(CSOUND *csound, FUNC *ftp, FGDATA *ff)
{
/* the function table */
MYFLT* fp = ftp->ftable;
/* f-statement p5, the range */
MYFLT range = ff->e.p[5];
/* step is range/tablesize */
double step = (double)
range/(ff->e.p[3]);
int i;
double x;
/* table-filling loop */
for(i=0, x=FL(0.0); i<ff->e.p[3];
i++,x+=step)
*fp++ = (MYFLT)tanh(x);
}

static NGFENS localfgens[] = {
{ “tanh”, (void(*)(void))tanhtable},
{ NULL, NULL}
};

#define S sizeof
static OENTRY *localops = NULL;
FLINKAGE

;———– test.csd ——————-
; dumps the content of an f table to
; the file “test.txt”

<CSoundSynthesizer>

<CsOptions>
-odac
</CsOptions>
<CsInstruments>
sr=44100
ksmps=1
nchnls=1

gisize init 32
gitest ftgen 1,0,gisize,44,2
;gitest ftgen 1,0,gisize,10,1
; tabnum ftgen ifn, itime, isize, igen, arg1 …. argn

instr 1

kndx init 0

if (kndx<gisize) then
        kres tab kndx, gitest
        fprintks “table.txt”, “%2.2f\n”, kres
        kndx = kndx+1
endif

endin

</CsInstruments>

<CsScore>

i1 0.0 1

e

</CsScore>
</CSoundSynthesizer>

Send bugs reports to this list.
To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk

Leave a Comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.