Is there a good way to limit the amount of decimals for the value returned by for example a vb:slider.
I realize I can do some handling in the notifier function, but then the binding is pretty useless if I have to do the handling manually anyway.
Consider this:
vb:slider {
id = "slider_dco1_lfo_mod_depth",
min = 0,
max = 127,
value = 64,
width = 170,
bind = instrument.dco1_lfo_mod_depth,
notifier = function(value)
send_sysex(sysex_dco1_lfo_mod_depth, value)
end
},
vb:value{
bind = instrument.dco1_lfo_mod_depth
}
So, the value from the slider is to be sent via sysex, and it it also bound to a variable in a document object (“instrument”).
But I want the value to be without decimals, both the value that is sent via sysex, the value stored in the document, and the value displayed by the vb:value.
I’m not at home with Renoise but I know I did something to bind my Lines slider to show and output values with no decimals, or at least I think I remember doing so. Maybe not to the full extent you want but it’s only a small tool so maybe have a look see if you can pull out something useful.
I have to say that GUI in general, especially syncing sliders, value boxes and parameters, has been my biggest struggle with the API so far.
What I’m trying to do is a tool for editing parameters in a synth. So I have the idea to store the instruments you create in a document, so that you can exchange sounds with others.
So I thought it would be nice if the variables stored were the actual value displayed in the interface and the value send by sysex, ie
60 not 60.234234234
But, if i let that demand go, I could add an observable to each document variable, and when it is changed I send sysex from that notifier (instead of the ui notifier), that way, when you load a document (instrument) all the parameters are automatically sent to the synth.
And if I add the same rounding to the vb:value field then I’m home I think.