Your formula is identical to the one I'm using, more or less. This is a fencepost issue, or due to the way I define ticks. Ticks are "stops" on the way.
What we're talking about here is "gap" size. "Gaps" are the spaces between ticks.
0, 42, 84, 127 is using a gap size of 128/3. There are four ticks and THREE gaps: 0 to 42, 42-84, 84-127.
If I used 0, 32, 64, 127, you can see that the 64 to 127 range doesn't get broken up at all (0 to 64 passes through three stops/ticks, but 64-127 only passes through 2).
So if you want a gap size of 32, you would use a tick size of 5. Then you would get 4 gaps:
0-32, 32-64, 64-96, 96-127
If this "answer" doesn't work for you, I'd be glad to take another round or rounds on this. Please comment on this answer, or email me.
As always, thanks for your suggestions and attention to MIDI Designer. Users like yourself are what makes MIDI Designer so much bigger and better than anything I could've come up with on my own.