>> In this example, everything looks fine when there are max. 3 nested >> analysis brackets (first score). However, when the brackets are 4 >> the distance between them is irregular. >> >> Moreover, how to reverse the order of the brackets so that the >> shortest ones are closer to the staff? > > Compiling your code with my copy of Lilypond (2.25.11) gives four > evenly-spaced brackets with the shortest ones closer to the > staff. Maybe it’s a bug introduced since 2.25.11?
Not a bug but an intentional change, see https://gitlab.com/lilypond/lilypond/-/merge_requests/2196 , which was merged in version 2.25.12. The documentation changes of this MR also describe how to order the brackets as needed. Werner