Even if, as suggested later in the thread, you have ossia-above and
ossia-below, I don't think that should affect this ordering. Any
analogy with the << { } \\ { } >> construction is probably unwise,
as that's something which appears not always to be understood anyway.
On a second thought, I agree. Ordering of arguments in this function seems to be of utmost importance, not only because of the \relative construction, but also because the function needs to appear first no matter what (I can't for example use {#music } \ossiaBelow {#ossia-music}). So it makes more sense to attach the notes that the function appears to contain on its side and not afterwards. For the sake of "discoverability" here the code again with #ossia-music back to where it belongs:
\version "2.20.0"
\layout {
\context {
\Staff
\name OssiaStaff
\alias Staff
\remove "Time_signature_engraver"
\magnifyStaff #2/3
%\hide Clef
%firstClef = ##f
instrumentName = "ossia"
shortInstrumentName = "ossia"
}
\inherit-acceptability OssiaStaff Staff
}
ossiaAbove =
#(define-music-function
(ossia-music music)
(ly:music? ly:music?)
(let ((staff-name #f)
(clef-props '(clefGlyph
middleCClefPosition
clefPosition
clefTransposition
clefTranspositionStyle)))
(define (initialize context)
(set! staff-name
(ly:context-id (ly:context-find context 'Staff)))
(set! clef-props
(map (lambda (prop)
(cons prop (ly:context-property context prop)))
clef-props)))
(define (update context)
(ly:context-set-property! context
'alignAboveContext staff-name)
(for-each (lambda (prop)
(ly:context-set-property! context
(car prop) (cdr prop)))
clef-props)
(ly:set-middle-C! context))
#{ \applyContext #initialize
<< \new OssiaStaff
\with #(ly:make-context-mod `((apply ,update)))
{ #ossia-music }
#music >> #}))
ossiaBelow =
#(define-music-function
(ossia-music music)
(ly:music? ly:music?)
(let ((staff-name #f)
(clef-props '(clefGlyph
middleCClefPosition
clefPosition
clefTransposition
clefTranspositionStyle)))
(define (initialize context)
(set! staff-name
(ly:context-id (ly:context-find context 'Staff)))
(set! clef-props
(map (lambda (prop)
(cons prop (ly:context-property context prop)))
clef-props)))
(define (update context)
(ly:context-set-property! context
'alignBelowContext staff-name)
(for-each (lambda (prop)
(ly:context-set-property! context
(car prop) (cdr prop)))
clef-props)
(ly:set-middle-C! context))
#{ \applyContext #initialize
<< \new OssiaStaff
\with #(ly:make-context-mod `((apply ,update)))
{ #ossia-music }
#music >> #}))
<<
\new StaffGroup \with {
\override SystemStartBracket.stencil = ##f
\override SpanBar.glyph-name = #"!"
}
<<
\new Staff = "violin"
\relative {
c'4 d e g
f d e g
f d e g
\time 3/4
c b c
\time 4/4
\ossiaAbove {c b c2 }
{e4 f g2}
}
>>
\new StaffGroup \with {
\override SystemStartBracket.stencil = ##f
\override SpanBar.glyph-name = #"!"
} <<
\new Staff = "viola"
\relative {
\clef alto
c'4 d e g
f d e g
f d e g
\time 3/4
\ossiaBelow { e d f }
{ c b c }
\time 4/4
c b c2
}
>> >>
Cheers,
Martín.