Tableikt and tablek opcode in general, click

Hi,

I cannot figure out why I have some clicks in this instrument. Is it releated to the guarding point? Even if I change the size or the table nothing happens. It works without clicks only if ksmps = 2 or less.

giasine			ftgen	0, 0, 8192, 9, .5, 1, 0

    instr 1

kdiv init 8
kndx = ((phasor:k(.5)*kdiv))%1
ktab = giasine
aring tableikt a(kndx), ktab, 1, 0, 0
aout = oscili(.25, 300)*aring
    outall aout
    
    endin

Late response but in case it’s still relevant:

I’m not exactly sure why you are running the phasor at k rate & then converting to a rate in the tableikt parameters but running the phasor at a rate eliminates the clicks (for me anyways).

instr 1

kdiv init 8
andx = ((phasor(.5)*kdiv))%1
ktab = giasine
aring tableikt andx, ktab, 1, 0, 0
aout = oscili(.85, 300)*aring
outall aout

endin

Thank you, never too late.
I was running at k rate because the exemple is a transposition of my livecoding system where a phasor is the time and controls the events. For this reason the idea was to keep it a k rate.

U are right, at a rate everything works fine, but what I do not understand is the reason why clicks are only when the buffer is read again. It means that it’s not a problem of a or k rate because normally the interpolation kicks in.

By buffer being read do you mean the click does not occur at the start but does each time the phasor restarts at 0? I could be wrong but suspect that would be because the first k-cycle would start at exactly 0 seconds (so no click), each subsequent phasor cycle likely starts x ksmps later.

For example, I tried it at 10 ksmps (see linked pic). And I think the interpolation is working because it’s a “soft-click”, you can see it tapered over 10 samples, although that’s enough that it’s still audible.

A harsher click might be amplitude changing between 2 samples.

Obviously at 5 ksmps the click gets softer, at 2 it’s essentially inaudible. But at say 64 it doesn’t sound like a click, more like a thud which is likely due to the interpolation. I think without interpolation, at 64 ksmps you’d likely get a pretty hard click, not tapered like this:

Again I’m just guessing, I could be wrong.

I’m sure you’ve already considered this but you could still pass the phasor to other instruments at krate via gk.

instr 1

kdiv init 8
andx = ((phasor(.5)*kdiv))%1
gkndx = andx
ktab = giasine
aring tableikt andx, ktab, 1, 0, 0
aout = oscili(.85, 300)*aring
outall aout

endin

instr 2

kndx = gkndx
printk .1, gkndx
endin

Note: I’m not sure why the above is wrapping, clearly I’m doing something wrong…