lilypond-user
[Top][All Lists]
Advanced

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

Re: stem length in voice one of bass too long


From: MING TSANG
Subject: Re: stem length in voice one of bass too long
Date: Wed, 29 Feb 2012 18:22:04 -0800 (PST)

I check the lilypond user archives and couldn't find my attachements (snippet, pdf and png). It must have been lost.    Here I copy the snippet.  I apologize for the length.  It is the best I can reduce to show my problem - stem on voice one on Base is too tall/long.  How can I reduce it. I try "\override Stem #'length-fraction = #(magstep -3)", but it affect stems on quarter notes, half notes but not on eighth & 16th notes.   What must I do in order that the stems for 8th & 16th notes can be shortened?   Can I try the attachments again?

Thanks for the help.

Blessing in+,
Ming.

%%%%%%%%%%%%SNIPPET
 %%{
\version "2.14.0"
\include "english.ly"
%{
 ti = "我 全 心 信 靠 : I-just-keep-trusting-my-lord"
 st = " . . . . . . . . . . "
 sy=2   \include "D:/lily_pond/include_paper-header-footer-filename-footnote.ly"
 %}
  % {
\header {
  title = "我 全 心 信 靠 : I-just-keep-trusting-my-lord"
  composer = "Composer"
  arranger = "Arranger"
  tagline = \markup {
    Engraved on
    \simple #(strftime "%x at %X" (localtime (current-time)))
    with
    \with-url #"http://lilypond.org/web/" {
      LilyPond \simple #(lilypond-version) (http://lilypond.org/)
    }
  }
}
%}
%======================================================
%%%%\include "d:/lily_pond/include_merge-rest.ly"
#(define (rest-score r)
  (let ((score 0)
    (yoff (ly:grob-property-data r 'Y-offset))
    (sp (ly:grob-property-data r 'staff-position)))
    (if (number? yoff)
    (set! score (+ score 2))
    (if (eq? yoff 'calculation-in-progress)
        (set! score (- score 3))))
    (and (number? sp)
     (<= 0 2 sp)
     (set! score (+ score 2))
     (set! score (- score (abs (- 1 sp)))))
    score))

#(define (merge-rests-on-positioning grob)
  (let* ((can-merge #f)
     (elts (ly:grob-object grob 'elements))
     (num-elts (and (ly:grob-array? elts)
            (ly:grob-array-length elts)))
     (two-voice? (= num-elts 2)))
    (if two-voice?
    (let* ((v1-grob (ly:grob-array-ref elts 0))
           (v2-grob (ly:grob-array-ref elts 1))
           (v1-rest (ly:grob-object v1-grob 'rest))
           (v2-rest (ly:grob-object v2-grob 'rest)))
      (and
       (ly:grob? v1-rest)
       (ly:grob? v2-rest)                
       (let* ((v1-duration-log (ly:grob-property v1-rest 'duration-log))
          (v2-duration-log (ly:grob-property v2-rest 'duration-log))
          (v1-dot (ly:grob-object v1-rest 'dot))
          (v2-dot (ly:grob-object v2-rest 'dot))
          (v1-dot-count (and (ly:grob? v1-dot)
                     (ly:grob-property v1-dot 'dot-count -1)))
          (v2-dot-count (and (ly:grob? v2-dot)
                     (ly:grob-property v2-dot 'dot-count -1))))
         (set! can-merge
           (and
            (number? v1-duration-log)
            (number? v2-duration-log)
            (= v1-duration-log v2-duration-log)
            (eq? v1-dot-count v2-dot-count)))
         (if can-merge
         ;; keep the rest that looks best:
         (let* ((keep-v1? (>= (rest-score v1-rest)
                      (rest-score v2-rest)))
            (rest-to-keep (if keep-v1? v1-rest v2-rest))
            (dot-to-kill (if keep-v1? v2-dot v1-dot)))
           ;; uncomment if you're curious of which rest was chosen:
           ;;(ly:grob-set-property! v1-rest 'color green)
           ;;(ly:grob-set-property! v2-rest 'color blue)
           (ly:grob-suicide! (if keep-v1? v2-rest v1-rest))
           (if (ly:grob? dot-to-kill)
               (ly:grob-suicide! dot-to-kill))
           (ly:grob-set-property! rest-to-keep 'direction 0)
           (ly:rest::y-offset-callback rest-to-keep)))))))
    (if can-merge
    #t
    (ly:rest-collision::calc-positioning-done grob))))
%======================================================
%%%%\include "D:/lily_pond/include_number-notehead_smaller.ly"
#(define Ez_numbers_engraver
  (list
    (cons 'acknowledgers
          (list
          (cons 'note-head-interface
                (lambda (engraver grob source-engraver)
                  (let* ((context (ly:translator-context engraver))
                          (tonic-pitch (ly:context-property context 'tonic))
                          (tonic-name (ly:pitch-notename tonic-pitch))
                          (grob-pitch
                          (ly:event-property (event-cause grob) 'pitch))
                          (grob-name (ly:pitch-notename grob-pitch))
                          (delta (modulo (- grob-name tonic-name) 7))
                          (note-names
                          (make-vector 7 (number->string (1+ delta)))))
                    (ly:grob-set-property! grob 'note-names
note-names))))))))
EzNum = {
    \easyHeadsOn
        \override Staff.StaffSymbol #'staff-space = #1.75
        \override Staff.StaffSymbol #'line-thickness = #1.0
        \override Staff.NoteHead #'font-size = #+1.75
        \override Staff.Clef #'font-size = #+1.25
        \override Staff.TimeSignature #'font-size = #+1.25
        \override Staff.Accidental #'font-size = #+1.25
        \override Voice.NoteHead #'font-size = #-1.5
        }
%======================================================
 mbk = \break
 global = {\key f\major  \time 4/4  \tempo 4 = 125}
 nrS = \override  NoteHead #'color = #red
 nbS = \override  NoteHead #'color = #blue
 nE = \revert  NoteHead #'color
 % {
 %==============================================
\include "i-just-keep-trusting-my-lord(SA).ly"
 SAh = \relative c' {
%{SA31-32%} bf1~ | bf4
 }
 %------------------------------------------------------------------------------
 SSi = \relative c' {
%{ S32-33%} bf'4 bf4 b4 | c8. c16 c8. c16~ c2~ | c2 \mbk
 }
 AAi = \relative c' {
%{ A32-33%} \nrS f4 f4 fs4 | g8. g16 g8. g16~ g2~ | g2\mbk
 }
%===============================================
\include "i-just-keep-trusting-my-lord(TB).ly"
 TBf = \relative c {
%{TB28-31%}  d'2  
 }
TTg = \relative c {
%{ T31-33%} d'4 d4 | d4 d4 d4 ds | e8. e16 e8. e16~ e2~ | e2 \mbk
 }
 BBg = \relative c {
%{ B31-33%} \nbS bf'4 bf4 | bf4 bf4 bf4 b4 | c8. c16 c8. c16~ c2~ | c2 \mbk
 }
%===============================================
\include "i-just-keep-trusting-my-lord(piano).ly"
PianoRH = \relative c' { \global      
%{rh31-33%} <f bf d>2 <f bf f'>2 | <bf f' bf>4 r4 r2 | <e,g c>2 c'8 d8 e8 g8 |\mbk
}
PianoLH = \relative c { \global \clef bass  
%{lh31-32%} <<{ f4( bf4) f4( d'4) }\\{ bf,2 bf2 }>> | <g d'>4 r4 r2 |
%{lh33   %} <<{ bf'4( c4) e,4( bf'4) }\\{ c,2 g2 }>> |
}
%===============================================
%}
%}

%%%%%%%%%%%%%%%%% SA_TB seperate + piano staff
% {
\score {
  \new GrandStaff = "GrandStaff_score" <<
        %\override RestCollision #'positioning-done = #merge-rests-on-positioning
        % {     
        \new ChoirStaff <<
          \new Staff \with {
               \override RestCollision #'positioning-done = #merge-rests-on-positioning
             } <<
%%%%%%%%        \override Score.BarNumber #'break-visibility = #'#(#t #t #t)
        \clef "treble"
        \global \partcombine
        \new Voice = "Sop"  {        \voiceOne  {
            {   \SAh  \SSi \label #'lastPage }   
        }}
        \new Voice = "Alto" {        \voiceTwo  {
            {   \SAh  \AAi }    
        }}
         \new Lyrics \lyricsto "Sop" { \SAlyricA   }
         \new Lyrics \lyricsto "Sop" { \SAlyricB   }
%        \new Lyrics \lyricsto "Sop" { \VerseFour  }
      >>
      \new Staff \with {
               \override RestCollision #'positioning-done = #merge-rests-on-positioning
               \override Stem #'length-fraction = #(magstep -3)
             } <<
        \clef "bass"
        \global
        \new Voice = "Tenor" {  \EzNum       \voiceOne  {  \TBf \TTg   }}
        \new Voice = "Bass"  {  \EzNum       \voiceTwo  {  \TBf \BBg   }}
        \new Lyrics \with { alignAboveContext = #"bass" } \lyricsto "Tenor" { \TBlyricA   }
        \new Lyrics \with { alignAboveContext = #"bass" } \lyricsto "Tenor" { \TBlyricB   }
    >>
         >>
         % }
    \new PianoStaff <<
      \set PianoStaff.connectArpeggios = ##t
      \new Staff = "RH" { \global            \PianoRH   }
      \new Staff = "LH" { \global \clef bass \PianoLH   }
    >>
  >>
   \layout {  indent = #'0   
    \context {
         \RemoveEmptyStaffContext
         \override VerticalAxisGroup #'remove-first = ##t
         \consists \Ez_numbers_engraver
    }
    \context {
      \Staff         
      \override TimeSignature #'style = #'()   
    }
  }
  \midi {
        \context {
      \Score
      tempoWholesPerMinute = #(ly:make-moment 125 4)
      midiMinimumVolume = #0.2
      midiMaximumVolume = #0.5
    }
%      \context { \Staff \remove "Dynamic_performer" }
  }
}
%}
%%%%%%%%%%%%%% SNIPPET ENDS

Blessing in+,

From: Francisco Vila <address@hidden>
To: MING TSANG <address@hidden>
Cc: lilypond-usermailinglist <address@hidden>
Sent: Wednesday, February 29, 2012 7:35:26 PM
Subject: Re: stem length in voice one of bass too long

2012/3/1 MING TSANG <address@hidden>:
> I was told to send to both address when I first join the list.

I think when you first joined, you were told this:

> Send lilypond-user mailing list submissions to
>     lilypond-user <at> gnu.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>     http://lists.gnu.org/mailman/listinfo/lilypond-user
> or, via email, send a message with subject or body 'help' to
>     lilypond-user-request <at> gnu.org

See also https://lists.gnu.org/mailman/listinfo/lilypond-user
--
Francisco Vila. Badajoz (Spain)
www.paconet.org , www.csmbadajoz.com



reply via email to

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