[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lilypond-user
Subject:    Re: problem of placing "\with {\consists #numbrUP}" on lilypond code
From:       Reinhold Kainhofer <reinhold () kainhofer ! com>
Date:       2012-12-11 14:32:47
Message-ID: 50C7440F.2080808 () kainhofer ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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, reinhold@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


[Attachment #5 (text/html)]

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 11/12/2012 02:51, MING TSANG wrote:<br>
    </div>
    <blockquote
      cite="mid:1355190697.53965.YahooMailNeo@web142603.mail.bf1.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff; font-family:Courier
        New, courier, monaco, monospace, sans-serif;font-size:14pt"><span>I
          have trouble placing <span style="color: rgb(255, 0, 0);">aa</span>="\with
          {\consists #numbrUP}" or <span style="color: rgb(0, 0, \
255);">bb</span>="\with  {\consists #numbrDOWN}" .</span></div>
    </blockquote>
    <br>
    I suppose you didn't include the " in the actual code, did you?<br>
    <br>
    <blockquote
      cite="mid:1355190697.53965.YahooMailNeo@web142603.mail.bf1.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff; font-family:Courier
        New, courier, monaco, monospace, sans-serif;font-size:14pt">
        <div style="color: rgb(0, 0, 0); font-size: 18.6667px;
          font-family: Courier New,courier,monaco,monospace,sans-serif;
          background-color: transparent; font-style: normal;"><span>Right
            now the test_number.ly &nbsp; compile with out as seen on
            test_numbr.pdf.</span></div>
        <div style="color: rgb(0, 0, 0); font-size: 18.6667px;
          font-family: Courier New,courier,monaco,monospace,sans-serif;
          background-color: transparent; font-style: normal;"><br>
          <span></span></div>
        <div style="color: rgb(0, 0, 0); font-size: 18.6667px;
          font-family: Courier New,courier,monaco,monospace,sans-serif;
          background-color: transparent; font-style: normal;"><span>I
            cannot compile if I add <span style="color: rgb(255, 0,
              0);">aa</span> to \new voice = "soprano" <br>
          </span></div>
        <div style="color: rgb(0, 0, 0); font-size: 18.6667px;
          font-family: Courier New,courier,monaco,monospace,sans-serif;
          background-color: transparent; font-style: normal;"><span>I
            cannot compile if I add <span style="color: rgb(0, 0,
              255);">bb</span> to \new voice = "alto"</span></div>
        <div style="color: rgb(0, 0, 255); font-size: 18.6667px;
          font-family: Courier New,courier,monaco,monospace,sans-serif;
          background-color: transparent; font-style: normal;"><span><span
              style="color: rgb(0, 0, 0);">I cannot compile if I add bb
              to \new voice = "bass"</span><br>
          </span></div>
        <div style="color: rgb(0, 0, 0); font-size: 18.6667px;
          font-family: Courier New,courier,monaco,monospace,sans-serif;
          background-color: transparent; font-style: normal;"><span></span></div>
        <div>If I code \new Staff \with {\consists #numbrUP&nbsp; ......<br>
          I can see numbered pitch stacked on top of the Staff. Please
          refer to test_numbrSA.pdf and test_numbrSA.ly.&nbsp; One other
          problem the on third last notes the numbered pitch display in
          wrong stack order.<br>
        </div>
      </div>
    </blockquote>
    <br>
    Actually, I cannot reproduce that problem. Here it works fine if I
    write \new voice="soprano" \with {\aa} {...}, like:<br>
    <br>
    nup=\with { \consists #numbrUP }<br>
    ndown=\with { \consists #numbrDOWN }<br>
    <br>
    choirPart = \new ChoirStaff &lt;&lt;<br>
    &nbsp; \new Staff \with {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; instrumentName = \markup \center-column { \
"S." "A." }<br>  &nbsp;&nbsp;&nbsp; shortInstrumentName = \markup \center-column { \
"S." "A." }<br>  &nbsp; } &lt;&lt; \clef treble&nbsp; <br>
    &nbsp;&nbsp;&nbsp; \new Voice =&nbsp; "soprano"&nbsp; \with{ \nup }&nbsp; \
{\voiceOne \sopranoVoice  } <br>
    &nbsp;&nbsp;&nbsp; \new Voice =&nbsp; "alto" \ndown&nbsp; {\voiceTwo \
\altoVoice&nbsp; } <br>  &nbsp;&nbsp;&nbsp; \new Lyrics \lyricsto "soprano" { \
\verseSopranoVoice&nbsp; }<br>  &nbsp;&nbsp;&nbsp; \new Lyrics \lyricsto "soprano" \
{\chineseLyrics}<br>  &nbsp; &gt;&gt;<br>
    &gt;&gt;<br>
    <br>
    <br>
    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.<br>
    <br>
    Cheers,<br>
    Reinhold
    <br>
    <pre class="moz-signature" cols="72">-- 
------------------------------------------------------------------
Reinhold Kainhofer, <a class="moz-txt-link-abbreviated" \
href="mailto:reinhold@kainhofer.com">reinhold@kainhofer.com</a>, <a \
class="moz-txt-link-freetext" \
                href="http://www.kainhofer.com">http://www.kainhofer.com</a>
 * Financial &amp; Actuarial Math., Vienna Univ. of Technology, Austria
 * <a class="moz-txt-link-freetext" \
                href="http://www.fam.tuwien.ac.at/">http://www.fam.tuwien.ac.at/</a>, \
                DVR: 0005886
 * Edition Kainhofer, Music Publisher, <a class="moz-txt-link-freetext" \
href="http://www.edition-kainhofer.com">http://www.edition-kainhofer.com</a></pre>  \
</body> </html>


["test_numbrSA.ly" (text/x-lilypond)]

\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 {}       
  
}



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic