conditional parenthesis

Walt North <[email protected]> Fri, 3 Jul 2026 22:49:57 -0700
Newsgroups gmane.comp.gnu.lilypond.general
Message-ID <[email protected]>
I have a case where I need to put parenthesis around some notes (not all 
notes) for a given instrument to emphasize a specific thing at certain 
points.

I thought this might be a case where tags would come in handy.

But the following doesn't add the parenthesis. What am I missing?  Is 
the problem related to having tags within a function? Or would there be 
a better way to do this.

\version "2.26.0"

par = #(define-music-function (note) (ly:music?)
    #{
    \tag #'(piano)  { #note }
    \tag #'(guitar)  { \parenthesize #note }
    #})

music = {c'1}

\score {
   {
     \keepWithTag #'piano {\par \music}
   }
}
\score {
   {
     \keepWithTag #'guitar {\par \music}
   }
}