Rounding values

Hello, I am wondering if it’s possible to round values generated by a Midi controller.
For instance, given

kmidctrl_1_1 ctrl7 1, 1, 0, 10
outvalue “ctrl1_1”, kmidctrl_1_1

I’d like to have (and display) values with only one decimal after the integer number.

Thank you for your help.

Hi!

One trick is
outvalue “ctrl1_1”, int(kmidctrl_1_1 * 10) / 10

tarmo

Kontakt Gppp via The Csound Community (<noreply@forum.csound.com>) kirjutas kuupäeval K, 21. veebruar 2024 kell 23:52:

Thank you Tarmo for you help, very useful!