lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tie & tag


From: Aaron Hill
Subject: Re: tie & tag
Date: Fri, 22 Nov 2019 09:16:41 -0800
User-agent: Roundcube Webmail/1.3.8

On 2019-11-22 7:49 am, Gianmaria Lari wrote:
I tried (again) with PushToTag with no success. And I don't understand why
it doesn't work. Here it is the code:

\pushToTag and \appendToTag only work on things that have an elements property. So that means this expression is valid but useless:

    \pushToTag #'here c' \tag #'here g'

Instead, consider the following variations:

%%%%
\version "2.19.83"
\pushToTag #'here c' \tag #'here { g' }
\pushToTag #'here c' \tag #'here < g' >
\pushToTag #'here c' \tag #'here << g' >>
%%%%

Curiously, this means you can use chords as a way to insert post-events like the tie, even in version 2.19:

%%%%
\version "2.19.83"
\include "articulate.ly"
melody = \fixed c' { g8 a \tag #'here <b> b a \tag #'here <g> g f }
<< \melody
   \appendToTag #'here ~ \melody
   \articulate \appendToTag #'here ~ \melody >>
%%%%

Note the above is also \articulate-friendly.

Going back to your code, we could modify it thusly with a few handy helpers:

%%%%
\version "2.19.83"
\include "articulate.ly"

tieHere = \tag #'tieHere \etc
appendTie = \appendToTag #'tieHere ~ \etc

screenOut = \tag #'screenOut \etc
midiOut = \tag #'midiOut \etc
\tagGroup #'(screenOut midiOut)

nc = { \midiOut \tieHere <c c'> \screenOut \tieHere <c'> }
nd = { \midiOut \tieHere <d d'> \screenOut \tieHere <d'> }
myScore = { \appendTie \nc \nc \nd \nc \appendTie \nd \nd }
\score { << \keepWithTag #'screenOut \myScore
            \articulate \keepWithTag #'midiOut \myScore >> }
%%%%

Mind you, if all you needed was to have MIDI-only notes sprinkled throughout, then you can simplify the approach as follows:

%%%%
\version "2.19.83"
\include "articulate.ly"

tieHere = \tag #'tieHere \etc
appendTie = \appendToTag #'tieHere ~ \etc

midiOnly = \tag #'midiOnly \etc
removeMidiOnly = \removeWithTag #'midiOnly \etc

nc = \tieHere <\midiOnly c c'>
nd = \tieHere <\midiOnly d d'>
myScore = { \appendTie \nc \nc \nd \nc \appendTie \nd \nd }
\score { << \removeMidiOnly \myScore
            \articulate \myScore >> }
%%%%

Note how above we avoid duplicating the c' and d' notes that are to be seen and heard.


-- Aaron Hill



reply via email to

[Prev in Thread] Current Thread [Next in Thread]