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.


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


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

Thank you Tarmo for you help, very useful!