spacemanspiff2007 / PyArtNet

"Python wrappers for the Art-Net protocol to send DMX over Ethernet"
GNU General Public License v3.0
70 stars 14 forks source link

universe output correction can't be overwritten to linear by channel #14

Closed mvandenabeele closed 2 years ago

mvandenabeele commented 3 years ago

Hi

If a universe has output_correction configured to eg quadratic, it is not possible to set channel output_correction to linear, because that would be value None and the code falls back to universe output_correction.

spacemanspiff2007 commented 3 years ago

You can just add an output correction yourself to the channel:

def linear(val: float, max_val: int = 255):
    return val
mvandenabeele commented 3 years ago

Thanks. That's what I ended up doing after I found the issue. But it's counterintuitive in my opinion. But in the end, it's your choice ofcourse. I can't thank you enough for the effort you put into this and for sharing with the community.

spacemanspiff2007 commented 3 years ago

I can probably add this to the available output corrections. What would be your suggestion that still allows to set the correction on the whole universe?

mvandenabeele commented 3 years ago

I'd add your suggested linear function to output_corrections.py. Setting the channel output_correction to None would make it fallback to the universe output_correction. If that is None as well, I'd fallback to the linear function as a default.