Page 1 of 1

Rounding?

Posted: Sun Oct 27, 2013 10:37 am
by freadZdead
On a minor side note, how are the OSC and/or MIDI values derived? and how the displayed percentages of the software? I am using the MIDI channels for display purposes, and something odd is happening with the rounding, I believe... probably not even in LXConsole, but it would help me to understand how LXconsole is doing it, i.e. - are the OSC/MIDI values being derived straight from the DMX value? which is derived from the percentage entered? or which way around/with what rounding algorithms is is done?

Thanks for the info :)!

Posted: Sun Oct 27, 2013 6:38 pm
by admin
All levels in LXConsole are internally represented in floating point format in the range 0.0 to 100.0. They are converted to DMX (0-255) output using the standard formula:

dmx = round((level/100)*255)

The values are stored in a file in hex format using standard USITT ASCII and converted to and from percentages as outlined above.

A similar formula is followed for MIDI, except the range is, of course, 0-127 rather than 0-255.

midi = round((level/100)*127)

OSC arguments are floating point, either 0.0-1.0 or 0.0-100.0. For example, TouchOSC controls generally send arguments in the range 0.0-1.0 and are converted to a level by multiplying by 100.

Posted: Thu Oct 31, 2013 2:09 am
by freadZdead
Hi Claude,


Thanks for the info - makes sense and is sensible, so I passed it on and will hopefully be able to solve it :).