[Csnd] vco2init...

I’m trying to use a custom waveform with the vco2 opcode, but I’m not getting the results I expect. Consider the following code.

gitable ftgen 1, 0, 16, 2, 0, -1, 0.1, -.5, .5, 1, 0, .5, -1, 0.1, -.5, .5, 1, 0
gi_nextfree vco2init -gitable, gitable+1, 1.01, 16, 2^16, gitable
gitable_bl = -gitable

instr 1
kEnv madsr .1, .3, .7, .1
kfn vco2ft p4, gitable_bl
asig oscilikt p5kEnv, p4, kfn
;asig vco2 p5
kEnv, p4, 14
outs asig, asig
endin

Aliasing starts to appear around C7 on a keyboard. If I swap out the vco2ft and use a vco2 instead I get a similar result, but at a certain point it blows up:

number of samples out of range: 1532 1532
rtevent: T 8.059 TT 8.059 M:38303999843885432520258064841565329771946742494741221801962820961020800752298138120353004414942616191341590740741052340150746300284022174263790044053759

The example in the manual seems to work fine. So what am I doing wrong, is my initial table too small?

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

I see this in the manual:

isrcft should point to a function table containing the waveform to be used for generating the table array. The table size is recommended to be at least imaxsiz points.

You have a 16-pt table but your max size is 2^16

The manual example works fine.

Thanks Victor, I’ll try that when I get a chance. I had a feeling I missed an important part of the puzzle…