On Sun 27 Sep 2020 at 04:25:21 (-0700), Aaron Hill wrote: > On 2020-09-27 3:23 am, Martín Rincón Botero wrote:
> > When I look at the code (see below) I would expect this to happen:
> > \ossia {%ossiamusic} {%music}. What happens is the opposite. This is
> > trivial, since the only thing you have to tell the user is that the
> > normal music goes before the ossia music, but it makes me wonder why
> > […] Other minor issues are […] that placing all this inside a
> > \relative is not reliable (the first note of whichever of both
> > components might be in an unexpected octave). Does Urs, who started
> > working on this, or David (or anyone :-)) have any idea on how to
> > solve these minor issues? Here the amended code with an example that
> > demonstrate them:
> I can see no reason why the order of arguments could not be swapped so
> that the ossia-music comes first. This is very useful as it clarifies
> why \relative works the way it does. The ossia-music expression gets
> processed before the remaining music. The first "c" in the remaining
> music follows the final "e" in the ossia-music, not the "g" is the
> preceding music.
I'm not sure that it does produce clarity (as opposed to merely
explaining the unreliability in perception). Would it not be
clearer to put the ossia music inside a \relative{}, so that
the main sequence of pitches carries through undisturbed, and
the ossia has its correct octave specified within itself, locally.
I always think it rather risky to put structure inside \relative{},
rather than putting the \relative{}s inside the structure.
In the attached, I have omitted any clefs so that notes can be
read more simply, and chosen the notes so that the octavation
of each segment is more obvious.
Cheers,
David.
\header { tagline = ##f }
ossia =
#(define-music-function
(music ossia-music) (ly:music? ly:music?)
(let ((name "initialized"))
#{
\applyContext
#(lambda (context)
(set! name (ly:context-id (ly:context-find context 'Staff)))
)
<< \new Staff \with {
#(ly:make-context-mod
`((apply ,(lambda (c)
(set! (ly:context-property c 'alignAboveContext)
name)
))))
\remove "Time_signature_engraver"
\magnifyStaff #2/3
\hide Clef
firstClef = ##f
} { #ossia-music }
#music
>>
% Create \new Staff with ossia-music
#}))
\new Staff = "foo" \relative {
c'4 f b e
\ossia { a^"main" f d b } { f^"ossia" c g d }
f g a2
}
\new Staff = "foo" \relative {
c'4 f b e
\ossia { a^"main" f d b } \relative { f''^"ossia" c g d }
f g a2
}
botero.pdf
Description: Adobe PDF document
