On 2024-01-16 8:06 am, Hajo Baess wrote:
Hello LilyPond users,

I wonder if there is a possibility to define a custom bar length, thus
for once cancelling LilyPond's automatic insertion of bar lines.

I have a complicated measure here with quite a bit of markup to
accommodate in one bar. I have worked out a solution which is maybe
good enough, but it contains lots of tweaks in order to squeeze
everything into the automatically assigned bar length.

If I could define my own bar lengths, I would get more space in the
bar, so I hope at least. My search in the documentation did not yield a
result for me, but maybe I did not look in the right places.

Hopefully someone here can troubleshoot me.
Any help is much appreciated.

I suspect we are going to need more information as there are at least two interpretations of "length" here.

This is why we highly recommend including MWEs (minimum working examples) with questions, as this gives us a common starting point without having to make potentially derailing guesses.

----

Length interpretation one: Metrical length (i.e. number of beats in a bar)

If you need to momentarily step away from the defined time signature, the easiest option I find is to use a cadenza--a section of music that is not bound by the time signature. Begin the section with \cadenzaOn, cram whatever notes you want, and then end the section with \cadenzaOff to resume the original time signature.

NOTE: LilyPond will not attempt to subdivide a cadenza on its own for the purposes of line breaking. You can of course provide hints using \bar "" as needed.

For more information, see: NR 1.2.3 - Displaying Rhythms; Unmetered Music
https://lilypond.org/doc/v2.24/Documentation/notation/displaying-rhythms#unmetered-music

----

Length interpretation two: Dimensional width (i.e. physical space on the paper)

LilyPond's spacing engine tries to keep things unified across the music, so notes should look consistently spaced throughout the piece. You can define a new "spacing section" within your score with the aptly named \newSpacingSection command. Each use of this command will break up the larger score into chunks that the spacing engine will handle independently. There are several context properties that affect note spacing, and these can be adjusted within each spacing section as desired.

For your scenario of a measure that just needs to be wider than everyone else, you would at a minimum need to start a new spacing section coming into the measure and then start yet another section for the subsequent measure--a total of three sections: one before, one for the "fat" measure, and one after.

For more information, see: NR 4.5.2 - New Spacing Section
https://lilypond.org/doc/v2.24/Documentation/notation/new-spacing-section

----

If you are talking about something else entirely, please see about providing a brief example of what you have tried.


-- Aaron Hill

Reply via email to