Hi Pierre,
Maybe it's a silly question but why not simply something like:
\version "2.18"
{ c'1 \bar ".|:" c' c' c' \bar ":|." c' c' }
Cheers,
Pierre
It is not at all silly. The path to the answer is a bit convoluted.
The issue is breaks. A \bar command needs a Bar_engraver to listen to
it. If you have the Bar_engraver turned on, breaks are only allowed at
bar lines. And since the OP wanted unmetered music with no bar lines
except for repeats, although breaks would be permitted everywhere, you
would need empty bar lines as break points − the typical \bar "".
To insert these automatically, you would make all the regular bar lines
the empty type (\set Score.defaultBarType = ""), with very short
measures to effectively allow a break anywhere, e.g., \time 1/8.
Unfortunately, this is currently buggy:
https://gitlab.com/lilypond/lilypond/-/issues/4084
In short, an empty bar line that occurs in the middle of a note triggers
a programming error.
So my engraver was just a convenient way to spare the need for
\cadenzaOn and manually inserting \bar "" at strategic places. It is
mostly a way to lift the restriction that breaks can only occur at bar
lines.
Headache ends here. I don't guarantee not having missed a corner
rendering the engraver unnecessary…
I hope this clarifies it.
Cheers,
Jean