# Standard way for a control, but k display?

**URL:** <https://forum.cabbageaudio.com/t/standard-way-for-a-control-but-k-display/4382>\
**Category:** Cabbage Stew\
**Created:** [11 June 2024 13:29 UTC](https://forum.cabbageaudio.com/t/standard-way-for-a-control-but-k-display/4382 "2024-06-11T13:29:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bryan\_T](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/bryan_t/32/5680_2.png) [@Bryan\_T](https://forum.cabbageaudio.com/u/Bryan_T)\
**Post date:** [11 June 2024 13:29 UTC](https://forum.cabbageaudio.com/t/standard-way-for-a-control-but-k-display/4382/1 "2024-06-11T13:29:46Z")

</div>

I’m building an effect that will have audio rate LFOs. I’ll want to update the GUI to reflect the faders turning at the LFO rates. I think I understand that I’ll want to translate the audio rate LFO to a k-rate control for Cabbage. Is there a standard way that this is done? If you could point me to an example .csd file, documentation, or a vid, I’d be really appreciative.

Thank you!

---

<div class="post-metadata">

**Author:** ![ST\_Music](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/st_music/32/4405_2.png) [@ST\_Music](https://forum.cabbageaudio.com/u/ST_Music)\
**Post date:** [11 June 2024 17:22 UTC](https://forum.cabbageaudio.com/t/standard-way-for-a-control-but-k-display/4382/2 "2024-06-11T17:22:49Z")

</div>

I think you can use k(aLfo) or the downsamp opcode which provides an optional averaging window:

```
instr 1
aLfo = lfo(1, .2)
kLfo = k(aLfo)
kLfo2 = downsamp(aLfo) 
printk .2, kLfo
printk .2, kLfo2
endin 

</CsInstruments>
<CsScore>
i1 0 5.1
</CsScore>
</CsoundSynthesizer>

```

[https://csound.com/docs/manual/downsamp.html](https://csound.com/docs/manual/downsamp.html)  
[https://csound.com/docs/manual/opk.html](https://csound.com/docs/manual/opk.html)

---

<div class="post-metadata">

**Author:** ![Bryan\_T](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/bryan_t/32/5680_2.png) [@Bryan\_T](https://forum.cabbageaudio.com/u/Bryan_T)\
**Post date:** [11 June 2024 19:03 UTC](https://forum.cabbageaudio.com/t/standard-way-for-a-control-but-k-display/4382/3 "2024-06-11T19:03:54Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [12 June 2024 08:12 UTC](https://forum.cabbageaudio.com/t/standard-way-for-a-control-but-k-display/4382/4 "2024-06-12T08:12:44Z")

</div>

Rather than update the control at rate, you might want to reduce the number of updates a second using the optional trigger parameter to `cabbageSetValue`. Updating at k-rate can put a bit of a load of the CPU.

---

<div class="post-metadata">

**Author:** ![Bryan\_T](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/bryan_t/32/5680_2.png) [@Bryan\_T](https://forum.cabbageaudio.com/u/Bryan_T)\
**Post date:** [12 June 2024 08:45 UTC](https://forum.cabbageaudio.com/t/standard-way-for-a-control-but-k-display/4382/5 "2024-06-12T08:45:57Z")

</div>

Thanks! I learned about using the metronome to trigger the updating. 30 times a second looked smooth enough to me. And much less taxing than the 1500 times a second my k-rate would be.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [12 June 2024 08:52 UTC](https://forum.cabbageaudio.com/t/standard-way-for-a-control-but-k-display/4382/6 "2024-06-12T08:52:21Z")

</div>

In the new version of Cabbage this won’t be much of a concern any more 😉 Things will be a lot smoother 🙂
