David Kastrup <d...@gnu.org> writes: > Gianmaria Lari <gianmarial...@gmail.com> writes: > >> Be patient with me. >> >> I expect this to generate {a~a} but it generates {a a} . Why? >> >> \version "2.23.2" >> music = {a \tag#'here a} >> {\pushToTag #'here ~ \music } >> >> The \displayLilyMusic output looks "correct". >> >> >> { { a4 \tag #'here { ~ } a4 } } > > How is { ~ } correct? ~ is not standalone music. > > At any rate, \pushToTag's documentation states: > > Sometimes you want to splice some music at a particular place in an > existing music expression. You can use ‘\pushToTag’ and ‘\appendToTag’ > for adding material at the front or end of the ‘elements’ of an existing > music construct. Not every music construct has ‘elements’, but > sequential and simultaneous music are safe bets: > > But you are not pushing to sequential or simultaneous music but rather > to the second a , a single note. This needs to be a sequential music > expression. > > So what you can push is <>~ though the tie event needs to occur at the > first note rather than the second. > > So: > > \version "2.23.2" > music = {\tag#'here {a} a} > {\pushToTag #'here <>~ \music }
Wait: while a NoteEvent does not have elements, a chord has and it takes articulations there. You could rather write
\version "2.23.2" music = {\tag#'here <a> a} {\appendToTag #'here ~ \music }
-- David Kastrup