# Tableikt and tablek opcode in general, click

**URL:** <https://forum.csound.com/t/tableikt-and-tablek-opcode-in-general-click/1127>\
**Category:** General\
**Created:** [March 5, 2023, 9:44am UTC](https://forum.csound.com/t/tableikt-and-tablek-opcode-in-general-click/1127 "2023-03-05T09:44:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cordelia](https://forum.csound.com/user_avatar/forum.csound.com/cordelia/32/279_2.png) [@Cordelia](https://forum.csound.com/u/Cordelia)\
**Post date:** [March 5, 2023, 9:44am UTC](https://forum.csound.com/t/tableikt-and-tablek-opcode-in-general-click/1127/1 "2023-03-05T09:44:14Z")

</div>

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.

```csound
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

```

---

<div class="post-metadata">

**Author:** ![ST\_Music](https://forum.csound.com/user_avatar/forum.csound.com/st_music/32/239_2.png) [@ST\_Music](https://forum.csound.com/u/ST_Music)\
**Post date:** [March 19, 2023, 10:02pm UTC](https://forum.csound.com/t/tableikt-and-tablek-opcode-in-general-click/1127/2 "2023-03-19T22:02:03Z")

</div>

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

```

---

<div class="post-metadata">

**Author:** ![Cordelia](https://forum.csound.com/user_avatar/forum.csound.com/cordelia/32/279_2.png) [@Cordelia](https://forum.csound.com/u/Cordelia)\
**Post date:** [March 20, 2023, 9:32am UTC](https://forum.csound.com/t/tableikt-and-tablek-opcode-in-general-click/1127/3 "2023-03-20T09:32:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ST\_Music](https://forum.csound.com/user_avatar/forum.csound.com/st_music/32/239_2.png) [@ST\_Music](https://forum.csound.com/u/ST_Music)\
**Post date:** [March 22, 2023, 1:54am UTC](https://forum.csound.com/t/tableikt-and-tablek-opcode-in-general-click/1127/4 "2023-03-22T01:54:22Z")

</div>

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.

[![](https://forum.csound.com/uploads/default/original/1X/0c4edeaf6bb05be2a027eec7b92108b7d4c37c7c.jpeg) ](https://dl.dropboxusercontent.com/s/wn9c2ew4oytsap1/10_ksmps.jpg?dl=0)

A harsher click might be amplitude changing between 2 samples.

[![](https://forum.csound.com/uploads/default/original/1X/1a845a074e7716e7b7de658cc3d1a61c21b0947d.jpeg) ](https://dl.dropboxusercontent.com/s/1pxdg5mm0pl5d52/hard_click.jpg?dl=0)

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:

[![](https://forum.csound.com/uploads/default/original/1X/84464e50c3b082735aa3e813209dc5f7707c90d0.png) ](https://dl.dropboxusercontent.com/s/bmfdg9ho24apd37/64_ksmps.png?dl=0)

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

---

<div class="post-metadata">

**Author:** ![ST\_Music](https://forum.csound.com/user_avatar/forum.csound.com/st_music/32/239_2.png) [@ST\_Music](https://forum.csound.com/u/ST_Music)\
**Post date:** [March 22, 2023, 1:56am UTC](https://forum.csound.com/t/tableikt-and-tablek-opcode-in-general-click/1127/5 "2023-03-22T01:56:58Z")

</div>

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…
