How to tie notes at different time points into a chord? - lilypond

I am trying to tie notes that are in sequence into a single chord (effectively simulating a slow arpegio):
{
\clef bass
r8
<<
\relative c {
<<
\autoBeamOff \tieDown
{cis8~ cis4~ cis8}
{s32 e16.~ e4~ e8}
{s16 fisis16~ fisis4~ fisis8}
{s16. ais32~ ais4~ ais8}
{s8 cis4 cis8}
>>
}
\\
\relative c{
\mergeDifferentlyDottedOn cis32[ e fisis ais]
}
>>
}
The red ties are missing in Lilypond (2.19)

The command you are looking for is \set tieWaitForNote = ##t. This is how it looks with your example:
{
\clef bass
r8
<<
\relative c {
<<
\set tieWaitForNote = ##t
\autoBeamOff \tieDown
{cis8~ cis4~ cis8}
{s32 e16.~ e4~ e8}
{s16 fisis16~ fisis4~ fisis8}
{s16. ais32~ ais4~ ais8}
{s8 cis4 cis8}
>>
}
\\
\relative c{
\mergeDifferentlyDottedOn cis32[ e fisis ais]
}
>>
}
Producing:
You might also want to use \tieNeutral for the chord and also set a minimum-length so that the top tie looks better:
{
\clef bass
r8
<<
\relative c {
<<
\set tieWaitForNote = ##t
\autoBeamOff \tieDown
{cis8~ cis4~ cis8}
{s32 e16.~ e4~ e8}
{s16 fisis16~ fisis4~ fisis8}
{s16.
\override Staff.Tie.minimum-length = #5.2
ais32~ ais4~ ais8}
{s8 \tieNeutral cis4 cis8}
>>
}
\\
\relative c{
\mergeDifferentlyDottedOn cis32[ e fisis ais]
}
>>
}
Producing:

Related

Lilypond : Adding lyrics into backslash temporary voices

I'm pretty new when it comes to details on Lilypond and I'm stuck on a problem.
Whenever I introduce two new temporary voices with backslash <<{ }\\\\{ }>>, the lyrics skip over those voices :
Lyrics = \lyricmode {Et lux per -- pe -- tu -- a }
\score {
\new ChoirStaff
<<
\new Voice = "soprano"
\relative c' {
\clef treble
c4 f8 f
<<{a a}\\{f f}>>
c'4
}
\new Lyrics \lyricsto "soprano" { \Lyrics }
>>
}
Here is the document: http://lilybin.com/xbi9lm/1
I've tried a lot of things, and one that does something interesting is this:
Lyrics = \lyricmode {Et lux per a }
LyricsTwo = \lyricmode {pe -- tu }
\score {
\new ChoirStaff
<<
\new Voice = "soprano"
\relative c' {
\clef treble
c4 f8 f
<<{a a}\\{f f}\new Lyrics \lyricsto "2" {\LyricsTwo}>>
c'4
}
\new Lyrics \lyricsto "soprano" { \Lyrics }
\new Voice = "alto"
\relative c' {
\clef treble
c1
}
>>
}
Here is the document : http://lilybin.com/xbi9lm/2
Using backslashes for temporary voices creates two voices named "1" and "2" so that's what I've tried, but somehow the lyrics get under the entire score ?
I use them a lot but for very short amount of notes/time.
I'm at a complete loss so if someone has a good solution for integrating lyrics into temporary multiple backslash voices, I'm all ears !
While for keyboard music I also use the << { … } \\ { … } >> notation a lot, for music with lyrics I prefer to give Lilypond one voice onto which to hang the lyrics. I leave out \\, and Lilypond will regard the inside of << … >> as belonging to the same voice. We want only one of the two to belong, so we explicitly declare a different voice for the other.
Lyrics = \lyricmode { Et lux per -- pe -- tu -- a }
\score {
\new ChoirStaff <<
\new Voice = "soprano" \relative c' {
\clef treble
c4 f8 f
<<
{ \voiceOne a a }
\new Voice { \voiceTwo f f }
>>
\oneVoice c'4
}
\new Lyrics \lyricsto "soprano" { \Lyrics }
\new Voice = "alto"
\relative c' {
\clef treble
c1
}
>>
}
Output:
The \voiceOne, \voiceTwo and \oneVoice macros I call are what your double-backslash notation also calls behind the scenes to get the voices look like voice 1 and 2 (mainly the stem directions). I trust you to fix the beaming.

stretch octava mark to end of measure

When a note has an octava mark, the end of the mark is at the end of the note. For long notes the visual effect is not satisfying. I would like to end the octava mark at the end of the measure.
This example shows what I mean:
\score {
\new PianoStaff
<<
\new Staff {
\relative c'' {
\clef treble \time 3/4
a4 b c | d8 c b4 a | g2.
}
}
\new Staff {
\relative c {
\clef bass \time 3/4
a2.
\ottava #2
\set Staff.ottavation = #"15"
b''2.
\ottava #0
c,,2.
}
}
>>
}
This is the result
I would rather have this
In order to accomplish that result, I added an extra voice with hidden notes, rendering the wanted result. The hidden voice forces the end of the octava mark to the end of the third note. My question is: is there a better/simpler way to obtain the same result?
This is the version with the 'hidden voice'
\score {
\new PianoStaff
<<
\new Staff {
\relative c'' {
\clef treble \time 3/4
a4 b c | d8 c b4 a | g2.
}
}
\new Staff {
\relative c {
\clef bass \time 3/4
a2.
\ottava #2
\set Staff.ottavation = #"15"
<<
\new Voice { \voiceOne b''2. }
\new Voice { \voiceTwo \hideNotes a4 b c \unHideNotes }
>>
\ottava #0
c,,2.
}
}
>>
}
There's no easy / nice way to do this. See OttavaBracket right endpoint?
The code I got from there was:
\once \override Staff.OttavaBracket.shorten-pair = #'(-1 . -9.5)
where in the pair affect the start and end points of the bracket.
\score {
\new PianoStaff
<<
\new Staff {
\relative c'' {
\clef treble \time 3/4
a4 b c | d8 c b4 a | g2.
}
}
\new Staff {
\relative c {
\clef bass \time 3/4
a2.
\ottava #2
\set Staff.ottavation = #"15"
\once \override Staff.OttavaBracket.shorten-pair = #'(-1 . -9.5)
b''2.
\ottava #0
c,,2.
}
}
>>
}
Update:
I think modifying your original answer on hiding notes seems the best answer to me.
Putting b as 1/3 of value and hiding and unhiding notes works:
b''2.*1/3 \hideNotes b b \unHideNotes.
Shorter code than:
\once \override Staff.OttavaBracket.shorten-pair = #'(-1 . -9.5), and the automatic behaviour that we all want.
\score {
\new PianoStaff
<<
\new Staff {
\relative c'' {
\clef treble \time 3/4
a4 b c | d8 c b4 a | g2.
}
}
\new Staff {
\relative c {
\clef bass \time 3/4
a2.
\ottava #2
\set Staff.ottavation = #"15"
b''2.*1/3 \hideNotes b b \unHideNotes % works
% b''2.*1/3 s s % doesn't work
\ottava #0
c,,2.
}
}
>>
}

Lilypond: how to add a balloon-text for clefs?

With `balloonGrobText' one can add a balloon for grob. But this does appearently not work for clefs.
Example:
\version "2.20.0"
\new Voice \with { \consists Balloon_engraver }{
\override Voice.BalloonTextItem.annotation-balloon = ##f
g'4
\balloonGrobText #'Flag #'(1 . -2) \markup{"Flag"}
\balloonGrobText #'Clef #'(1 . 2) \markup{"Clef"}
\clef F
b8
}
gives:
How to add the balloon-text for the F-clef?
You've put the balloon engraver in the Voice context, but Clef is part of the Staff context. Simply put it in the Staff context and it will work as expected.
Here's how I would rewrite your example:
\version "2.20.0"
\new Staff \with {
\consists Balloon_engraver
\override BalloonTextItem.annotation-balloon = ##f
}
{
g'4
\balloonGrobText #'Flag #'(1 . -2) \markup{"Flag"}
\balloonGrobText #'Clef #'(1 . 2) \markup{"Clef"}
\clef F
b8
}

How can I include ossia without creating a blank space?

I am trying to add an ossia staff above the upper staff of a grand
staff. Working from this mailing list post, I have
constructed a minimal example that almost does what I want. The
problem is that the entire score contains a blank space for the ossia
staff, even in systems that have no ossia.
Here is the example (truly, a melodious composition):
\version "2.18.2"
ossia = \new Staff = "ossia" \with {
\remove "Time_signature_engraver"
fontSize = #-2
\override StaffSymbol #'staff-space = #(magstep -2)
\override Clef #'transparent = ##t
\override KeySignature #'stencil = ##f
} {
\key b \major
\override Staff.BarLine #'allow-span-bar = ##f
\stopStaff
s2.*100 % ???
}
treble = \new Staff = "treble" {
\clef treble
\key b \major
\relative c' {
\repeat unfold 10 { b8 cis dis fis dis cis }
b4 dis fis |
b4
<<
{ dis, fis }
\context Staff = "ossia" {
\startStaff \tuplet 3/2 { dis8 b dis } fis4 \stopStaff
}
>> |
b2. |
}
}
bass = \new Staff = "bass" {
\clef bass
\key b \major
\relative c {
\repeat unfold 12 { fis,4 fis4 fis4 | }
b2.
}
}
pianoStaff = \new PianoStaff {
\compressFullBarRests
\time 3/4
<<
\ossia
\treble
\bass
>>
}
\paper {
#(set-paper-size "letter")
indent = 25\mm
short-indent = 5\mm
}
\score {
<< \pianoStaff >>
% This changes nothing:
% \layout { \context { \Staff \RemoveEmptyStaves } }
}
Here is the output (PNG image, 85 KB).
Some interesting things to note:
If I remove the s2.*100 at line 13 (marked % ???), or change the
value to anything smaller than 12, the ossia staff renders
completely incorrectly. It appears below the bass clef, includes the
clef and time signature, and is in the key of C (i.e., the rendered
notes include accidentals). Basically, it looks like it's failed to
notice that the ossia staff exists and has constructed a brand new
one. I suspect that this is because the ossia staff is supposed to
extend past each point where it is used—i.e., when switching staff
contexts, one can go "back in time" but not forward. I don't really
understand this, but I can live with it, as it doesn't seem to have
an intrinsic effect as long as \compressFullBarRests is enabled.
I have included the paper size in the MWE to force consistent
dimensions on different systems.
As I noted in the score, adding \RemoveEmptyStaves does not remove
the empty staves.
My question is: how can I keep the ossia staff rendered as it does in
this example (small and above the treble clef) without adding the
empty space on all previous systems?
\RemoveEmptyStaves is not working because the staves are within a PianoStaff, so you must add \remove "Keep_alive_together_engraver" to the \layout block. Here's a minimal example of a documentation snippet slightly modified:
\version "2.18.2"
\new PianoStaff
<<
\new Staff = "ossia" \with {
\remove "Time_signature_engraver"
\hide Clef
fontSize = #-3
\override StaffSymbol.staff-space = #(magstep -3)
\override StaffSymbol.thickness = #(magstep -3)
} \relative c'' {
R1*3
c4 e8 d c2
}
\new Staff \relative c' {
c4 b c2
e4 f e2
g4 a g2 \break
c4 b c2
g4 a g2
e4 d c2
}
>>
\layout {
\context {
\Staff \RemoveEmptyStaves
\override VerticalAxisGroup.remove-first = ##t
}
\context {
\PianoStaff
\remove "Keep_alive_together_engraver"
}
}
Your example is quite big, not a real MWE. s2.*100 doesn't make any sense to me. I suggest that you submit a smaller example.

How to reliably display a delayed turn?

I'm trying to typeset a short piano piece, 'Nocturne n°5' by John Field. My main problem occurs on bars 14, 17 and 38 where a gruppetto is rendered as a delayed turn with a natural sign.
This is how it looks like in one of the editions you can find on the Internet:
This what I can achieve myself:
This is the code that I have tried:
\version "2.8.12"
upper = \relative c'' {
\key bes \major
\time 12/8
%bar 14
d4.-> c2.
<<
{
c4.( f4. ees4 c8 bes4. c4.
des2.~\sf des4.)
}
\\
{
% we create the following sequence: { r8 d16 c16 b16 c16 }
s8
\single \hideNotes d16
\single \hideNotes c16
\single \hideNotes \once \set suggestAccidentals = ##t
\single \hideNotes \once \override AccidentalSuggestion #'outside-staff-priority = ##f
\single \hideNotes \once \override AccidentalSuggestion #'avoid-slur = #'inside
\single \hideNotes \once \override AccidentalSuggestion #'font-size = #-3
\single \hideNotes \once \override AccidentalSuggestion #'script-priority = #-1
\single \hideNotes b16-\turn
\single \hideNotes c16
% those spaces are to align with the second voice
% kept in the for the duration of the phrasing slur
s2. s2.
s2. s4.
}
>>
}
lower = \relative c {
\key bes \major
\time 12/8
%bar14
e8[( \sustainOn c'8 bes8 g'8 c,8 bes8]
e,8[ g'8 bes,8]
ees,8[ \sustainOn f'8 a,8])
d,8[( \sustainOn f'8 bes,8]
ees,8[ \sustainOff c'8 g8]
f8[ d'8 bes8]
f8[ ees'8 a,8])
}
\score {
\new PianoStaff
<<
\new Staff = "upper" { \clef treble \upper }
\new Staff = "lower" { \clef bass \lower }
>>
\layout { }
}
You'll notice that I chose to create a temporary polyphonic passage and I have a choice to hide either the upper or the lower voice. I have experimented with both but it seems more logical to keep the rendered voice on the upper side and keep the lower voice hidden. However, this make the turn appear on the lower part of the staff.
Edit
I have updated the question with a snippet that should now compile for others to try. My main problem is that the delayed turn happens during a passage that must span a phrasing slur. Since I could not find a way to have a slur span across single-voice and multi-voice passages, I need to keep the polyphonic passage for longer than just the delayed turn part.
How can I improve on the placement of the turn and the accidental.
In your updated example, the problem is different so I'm adding a new answer.
You are using the double backslash construct in the temporary polyphonic passage and the turn displays below the staff. This happens because you never define the voices explicitely. In the Notation Reference 1.5.2:
The << {…} \ {…} >> construct, where the two (or more) expressions
are separated by double backslashes, behaves differently to the
similar construct without the double backslashes: all the expressions
within this construct are assigned to new Voice contexts. These new
Voice contexts are created implicitly..
So LilyPond will assign \voiceOne to the first voice and \voiceTwo to the second voice. In \voiceTwo the \turn and other similar objects are displayed below the staff. I recommend reading Explicitly instantiating voices.
Solution: either remove the \\ or add \voiceThree in the second voice of the temporary polyphonic passage (\voiceOne is implicitely used in the first voice of the passage and if you use it in the second you'll have a collision with the slur; that's why you need \voiceThree).
You shouldn't use the \turn within a \markup block; instead, attach it immediately to the note:
\once \hideNotes b16-\turn
By the way, this is the example in the lilypond documentation.
I could not compile your snippet so I recreated it from scratch (disclaimer: I don't play piano and my musical knowledge is limited) but it looks fine to me:
\version "2.19.40"
global = {
\key bes \major
\numericTimeSignature
\time 12/8
}
right = \relative c'' {
\global
% bar 14
<<
{ d4.-> c2. c4.-2( | }
{
s1 s4
\once \set suggestAccidentals = ##t
\once \override AccidentalSuggestion.outside-staff-priority = ##f
\once \override AccidentalSuggestion.avoid-slur = #'inside
\once \override AccidentalSuggestion.font-size = -3
\once \override AccidentalSuggestion.script-priority = -1
\single \hideNotes
b4-\turn
}
>>
f'4.-5) ees4-3
}
left = \relative c {
\global
% bar 14
e8\sustainOn([ c' bes g' c, bes] e, g' bes, ees,\sustainOn f' a,) |
ees8\sustainOn f' bes,-2 f-5\sustainOff
}
\score {
\new PianoStaff
<<
\new Staff = "right" \right
\new Staff = "left" { \clef bass \left }
>>
\layout { }
}