jean-emmanuel / open-stage-control

Libre and modular OSC / MIDI controller
https://openstagecontrol.ammd.net
GNU General Public License v3.0
701 stars 88 forks source link

[Bug] #661

Closed CtrlZ-Music closed 3 years ago

CtrlZ-Music commented 3 years ago

I'm trying to set the max of midi range 127.0.0.1-1604359823463.log

jean-emmanuel commented 3 years ago

Not a bug, but an error in your code, that #{} block returns null, probably because you're dividing 127 by 0, you could add a fallback value to avoid that (#{whatever || 127} would fallback to 127 if whatever is null or zero).

CtrlZ-Music commented 3 years ago

I found my solution with It was a bit tricky because one fader as to set the max of an other with mixed with midi problems ... what a mess.

{
  "min": 0,
  "max": #{Math.min(127, @{text_stepsvalue_@{parent.variables.ID}}*2)|| 127}
}