I followed instruction from NR 6.2.5 Defining new contexts.
http://lilypond.org/doc/v2.11/Documentation/user/lilypond/Defining-new-contexts#Defining-new-contexts
With the definitions that follow :
1) I get two staves for one \new \StaffSA
2) their instrumentName don't print
What's wrong ?
Thanks,
Germain
ps: btw, are de sharps (#) well suited ? (i mean : in the right place ?)
at : "test-newcontext.png"
%% Test de définition d'un nouveau contexte
\version "2.11.47"
\include "english.ly"
Global = { \key f \major }
NotesDiscantus = { a'4 a'1 }
NotesCantus = { f'4 f'1 }
NotesFiller = { c'4 c'1 }
NotesBassus = { f4 f1 }
Words = \lyricmode { Ta __ daa }
%---------------%
StaffVoiceNames = %% for Staff context
#(define-music-function (parser location n-max-width s-one s-two)
(number? string? string?)
"Format and print voice names for one staff"
#{
\set Staff . instrumentName = \markup { \column {
\hcenter-in #$n-max-width $s-one
\hcenter-in #$n-max-width $s-two } }
#})
%---------------%
StaffSAVoiceNames = %% same as above, but for StaffSA context
#(define-music-function (parser location n-max-width s-one s-two)
(number? string? string?)
"Format and print voice names for one staff"
#{
\set StaffSA . instrumentName = \markup { \column {
\hcenter-in #$n-max-width $s-one
\hcenter-in #$n-max-width $s-two } }
#})
%---------------%
\layout % commun
{
\context { \Score
\remove Bar_number_engraver }
\context { \ChoirStaff %% si placé après déf. de StaffSA : idem
\consists Instrument_name_engraver
\override InstrumentName #'self-alignment-X = #LEFT
\accepts StaffSA }
\context { \Staff
\remove Time_signature_engraver
\override InstrumentName #'self-alignment-X = #RIGHT }
\context { \name StaffSA
\type "Engraver_group"
\alias Staff }
}
%---------------%
\score % 1
{
\new ChoirStaff
<<
\set ChoirStaff . instrumentName = "N°1 Strange behaviour :"
\new StaffSA
<<
\StaffSAVoiceNames #3 #"S." #"A." %% ne donne rien
% \StaffVoiceNames #3 #"S." #"A." %% ne marche pas non plus
\clef "G" \Global
\new Voice = "one" { \voiceOne \NotesDiscantus }
\new Voice { \voiceTwo \NotesCantus }
>>
\new Lyrics = thewords { s }
\new Staff
<<
\StaffVoiceNames #3 #"T." #"B."
\clef "F" \Global
\new Voice { \voiceOne \NotesFiller }
\new Voice { \voiceTwo \NotesBassus }
>>
\context Lyrics = thewords \lyricsto "one" { \Words }
>>
\layout { indent = 65\mm }
}
------------------------------------------------------------------------
------------------------------------------------------------------------
_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user