So I'm nearing completion of a somewhat large hardware control patch using Vanilla objects only in the most minimal and elegant manner I can come up with. It's mostly done, but there's one specific scaling issue that's holding things up ATM. I've come up with some ideas to solve the problem but those solutions are a bit ungainly and overly complex relative to the way I've coded the rest of the patch. So I'm interested if anyone on here has any better Vanilla-compatible ideas (trying to avoid use of externals here).
The hardware device has a number of parameters which can be accessed either by standard low-resolution midi control (0-127) OR by higher resolution system exclusive control (in one case, 0-164 thou the hi res max values vary between the different parameters being accessed). The patch contains dual sliders so that the parameters in question can be accessed both ways, and these sliders send data to both the receiving device to change the actual value as well as to a [set $1( message which is then connected to the other slider to reflect the updated value. Obviously this slider update value has to be compressed or expanded before being converted to the "set" value. That's not so much of a problem except that it has to replicate the same exact scaling that the hardware device uses or the updated value will be inaccurate relative to the adjusted hardware parameter.
For example, in the case of the 0-164 parameter, the hardware scales this to standard midi by jumping every 4th digit (so it drops 4, 8, 13, 17 etc from the hi res value). What is the simplest and most elegant way to add or subtract from the control range in order to replicate the same scaling in Pd Vanilla?