Hi Paolo, > unfortunately this method is trial and error as well.
Not if it’s a callback function. ;) You need to write code that determines how much to shorten/extend (by referencing the width of noteheads, etc.), and automatically applies the tweak. That’s how you make it not trial-and-error. That being said, if the 8va moves too far to the left, it would imply that earlier moments should be ottavated, so… Good luck! =) Best, Kieren.