On 11/12/2012 02:51, MING TSANG wrote:
> I have trouble placing aa="\with {\consists #numbrUP}" or bb="\with
> {\consists #numbrDOWN}" .

I suppose you didn't include the " in the actual code, did you?

> Right now the test_number.ly   compile with out as seen on test_numbr.pdf.
>
> I cannot compile if I add aa to \new voice = "soprano"
> I cannot compile if I add bb to \new voice = "alto"
> I cannot compile if I add bb to \new voice = "bass"
> If I code \new Staff \with {\consists #numbrUP  ......
> I can see numbered pitch stacked on top of the Staff. Please refer to
> test_numbrSA.pdf and test_numbrSA.ly.  One other problem the on third
> last notes the numbered pitch display in wrong stack order.

Actually, I cannot reproduce that problem. Here it works fine if I write
\new voice="soprano" \with {\aa} {...}, like:

nup=\with { \consists #numbrUP }
ndown=\with { \consists #numbrDOWN }

choirPart = \new ChoirStaff <<
  \new Staff \with {
       instrumentName = \markup \center-column { "S." "A." }
    shortInstrumentName = \markup \center-column { "S." "A." }
  } << \clef treble 
    \new Voice =  "soprano"  \with{ \nup }  {\voiceOne \sopranoVoice }
    \new Voice =  "alto" \ndown  {\voiceTwo \altoVoice  }
    \new Lyrics \lyricsto "soprano" { \verseSopranoVoice  }
    \new Lyrics \lyricsto "soprano" {\chineseLyrics}
  >>
>>


See the attached file for the full code. Notice that you have to place
the \with {\nup} and \ndown where you would put the \with clause for the
voice. If you want, you can leave out the \with, like I did in the alto
voice above, but in my opinion this is harder to read than when you
include the \with.

Cheers,
Reinhold

-- 
------------------------------------------------------------------
Reinhold Kainhofer, reinh...@kainhofer.com, http://www.kainhofer.com
 * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * Edition Kainhofer, Music Publisher, http://www.edition-kainhofer.com

\version "2.17.6"
\language "english"
%%%%\include "include_numbrs.ly"
numbrUP = #(make-engraver (acknowledgers
 ((note-head-interface engraver grob source)
    (let* (
      (context (ly:translator-context engraver))
      (tonic-pitch (ly:context-property context 'tonic))
      (tonic-index (ly:pitch-notename tonic-pitch))
      (event (ly:grob-property grob 'cause))
      (grob-pitch (ly:event-property event 'pitch))
      (grob-index (ly:pitch-notename grob-pitch))
      (delta (modulo (- grob-index tonic-index) 7))
      (name (list-ref '("1" "2" "3" "4" "5" "6" "7") delta))
      (newgrob (ly:engraver-make-grob engraver 'TextScript event)))
    (if (string= name "Hb")  (set! name "B"))
   (set! (ly:grob-property newgrob 'text) name)
   (set! (ly:grob-property newgrob 'direction) UP) ))))

numbrDOWN = #(make-engraver (acknowledgers
 ((note-head-interface engraver grob source)
    (let* (
      (context (ly:translator-context engraver))
      (tonic-pitch (ly:context-property context 'tonic))
      (tonic-index (ly:pitch-notename tonic-pitch))
      (event (ly:grob-property grob 'cause))
      (grob-pitch (ly:event-property event 'pitch))
      (grob-index (ly:pitch-notename grob-pitch))
      (delta (modulo (- grob-index tonic-index) 7))
      (name (list-ref '("1" "2" "3" "4" "5" "6" "7") delta))
      (newgrob (ly:engraver-make-grob engraver 'TextScript event)))
    (if (string= name "Hb")  (set! name "B"))
   (set! (ly:grob-property newgrob 'text) name)
   (set! (ly:grob-property newgrob 'direction) DOWN) ))))
\header {
  title = "Let There Be Light"
  subtitle = "必 得 見 光"
  meter = "Gently"
}

global = {
  \key ef \major
  \numericTimeSignature
  \time 3/4
  \tempo 4=86
}
 

sopranoVoice = \relative c' {
  \global
 

  %{29-31%} f8 ef4~ ef8 r8 f16 g16 | af8 g16 f8. ef8 f8 d8 |  ef4 r8    ef8 g8  bf8 |\break

}

verseSopranoVoice = \lyricmode {
  From the be -- gin -- ing, the Fa -- ther  had a mag -- nif -- i -- cent

  
}
chineseLyrics = \lyricmode {
  救  贖  計  劃  精  心  編  定  聖  經  啟  示  早  言
  
}
altoVoice = \relative c' {
  \global
 

  %{29-31%} f8 ef4~ ef8 r8 f16 g16 | af8 g16 f8. ef8 f8 d8 |  ef4 r8      bf8 ef8  g8 |\break

}

verseAltoVoice = \lyricmode {
}

tenorVoice = \relative c' {
  \global \clef bass
 

%{29-31%} f,8 ef4~ ef8 r8 f16 g16 | af8 g16 f8. ef8 f8 d8 | ef4 r8 g8 bf8 ef8 |\break

  
}

verseTenorVoice = \lyricmode {
}

bassVoice = \relative c {
  \global
  \dynamicUp

%{29-31%} f8 ef4~ ef8 r8 f16 g16 | af8 g16 f8. ef8 f8 d8 | ef4 r8         ef8 ef8 ef8 |\break

}

verseBassVoice = \lyricmode { 
}

right = \relative c' {
  \global

  %{29%} <bf ef>4~ q16 g16 <bf ef>8 g8 bf8 | <af c ef>4~ q16 f16 <<{ef'8 f8 d8}\\{<f, bf>4.}>> | <g bf ef>8 q8 q8 q8_> r4 |\break

}

left = \relative c {
  \global

    %{29%} g8. g8. g4. | f8. f8. bf8 bf8 bf8 | ef,8 ef8 ef8 ef8_> r4 |
    
}





pianoPart = \new PianoStaff \with {
  instrumentName = "Piano"
} <<
  \new Staff = "right" \with {
    midiInstrument = "acoustic grand"
  } \right
  \new Staff = "left" \with {
    midiInstrument = "acoustic grand"
  } { \clef bass \left }
>>
 

nup=\with { \consists #numbrUP }
ndown=\with { \consists #numbrDOWN }

% {%%%%%%%%%%%%%%%%               SA-TB+piano
choirPart = \new ChoirStaff <<
  \new Staff \with {
       instrumentName = \markup \center-column { "S." "A." }
    shortInstrumentName = \markup \center-column { "S." "A." }
  } << \clef treble  
    \new Voice =  "soprano"  \nup  {\voiceOne \sopranoVoice } 
    \new Voice =  "alto" \with{ \ndown } {\voiceTwo \altoVoice  } 
    \new Lyrics \lyricsto "soprano" { \verseSopranoVoice  }
    \new Lyrics \lyricsto "soprano" {\chineseLyrics}
  >>
  
       
  \new Staff \with { 
       instrumentName = \markup \center-column { "T." "B." }
    shortInstrumentName = \markup \center-column { "T." "B." }
  } <<
    \clef bass  
    \new Voice = "tenor" \nup    {    \voiceOne \tenorVoice }
    \new Voice = "bass"  \ndown     { \voiceTwo \bassVoice }
  >>
>>


\score {
  <<
    \choirPart
    \pianoPart
  >>
  \layout {}       
  
}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to