lilypond-user
[Top][All Lists]
Advanced

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

Fw: définition d'un nouveau cont exte


From: Germain G. Ivanoff-Trinadtzaty
Subject: Fw: définition d'un nouveau cont exte
Date: Fri, 13 Jun 2008 01:44:21 +0200


Hello,
 
I've got two problems defining a new context \StaffSA, based on \Staff.
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 }
}

Attachment: test-newcontext.png
Description: PNG image


reply via email to

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