Andrew Bernard <andrew.bern...@gmail.com> writes: > I have many chords where a note is a harmonic. I use the following for the > note inside the chord: > > \tweak NoteHead.stencil #ly:text-interface::print > \tweak NoteHead.font-size #1 > \tweak NoteHead.text #(markup #:musicglyph "noteheads.s0mi") > > How can I make this into what I am tempted to call a macro (I know that is > not lilypond terminology)? > > I have always been confused about the dash '-' used with tweak, and when to > use it and when not to.
When in doubt, always when tweaking a post-event (which gets written after a note). It tells LilyPond that the context of the expression is, well, a post-event. Sometimes LilyPond can figure it out on its own depending on what the expression is used for, sometimes it doesn't matter. But relying on either just makes your code less readable to you and others. > But my question is how to make this set of commands some osrt of > function so I can just say \harmonicNote for example. > > Doing this does not work: > > harmonicNote = { > \tweak NoteHead.stencil #ly:text-interface::print > \tweak NoteHead.font-size #1 > \tweak NoteHead.text #(markup #:musicglyph "noteheads.s0mi") > } > > I am aware this is Dumb Question of the week, but something is stopping me > seeing the answer. Do not ever use { } except for enclosing sequential music or markup lists. Braces have meaning. With reasonably recent 2.19, you could just write harmonicNote = -\tweak NoteHead.stencil #ly:text-interface::print -\tweak NoteHead.font-size #1 -\tweak NoteHead.text #(markup #:musicglyph "noteheads.s0mi") \etc Verbatim. -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user