Positioning tuplet numbers close to kneed beams

If you want to move tuplet numbers close to kneed beams on a single staff or between staves, this workaround automates the process. It ignores tuplets on ordinary beams or with visible brackets.

Important: to work properly, this method must be used with manual beaming.

Two functions are provided. The first moves the number along the Y-axis, and is called like so: \override TupletNumber #'Y-offset = #kneed-beam. The second function centers the number horizontally: \override TupletNumber #'X-offset = #center-on-beam.