Dear List,

I've been fighting a problem with horizontal spacing for some time now.
 I'm new to lilypond, but I've done my best to read the documentation
and I didn't see an obvious answer.

The first issue to tackle was getting 4 bars to each line, but I found
the bars-per-line-engraver which seems to work nicely without having to
use a spacing voice for line breaks (which I've done before).

The second issue involves the width of the measure required to notate a
certain triplet pattern.  I don't have high hopes that this can be
easily fixed, unless I replace that measure with some kind of place
holder and notate it properly on a page separate from the score.

The second issue is supposed to be fixed by proportional notation:

"LilyPond supports proportional notation, a type of horizontal spacing
in which each note consumes an amount of horizontal space exactly
equivalent to its rhythmic duration. This type of proportional spacing
is comparable to horizontal spacing on top of graph paper."

Graph paper spacing is exactly what I want, but I must be missing
something.

Referring to the attached code, is there any way to:

1. reduce the width of the \first measure

2. align the notes of the \first measure with the \second measure

I would need to reduce the \first measure by approx 75% to fit 4 of
them on one line.  How could I make that happen?  I'd be happy to have
a really squished version as a place holder in the score with a larger
more visible version on a separate page.

It's also worth noting that the printed pdf margins are stacking with
the lilypond margins.  I haven't looked into why yet.

I would also like the /first measure to have consistent spacing with
the \second measure.  The bass drum 8th notes in the /first measure of
the attached pdf illustrate the problem.  These 8th notes are not
evenly spaced.  Furthermore, the first three 8th notes in the /first
measure line up with the first three 8th notes of the /second measure.
 I think that's a clue, but I have no idea what it means.

According to the documentation:

http://lilypond.org/doc/v2.18/Documentation/notation/proportional-notat
ion

The proportionalNotationDuration is set by trial and error with no
clear indication of what an appropriate number would look like.  My
approach was to reduce the number until I saw no further change.

The proportionalNotationDuration only gets the notes approximately
located.  To dial them in the uniform-stretching property must be set.
 However, doing so does not fix the problem.

I even tried to address the inconsistent 8th note spacing by writing
triplet rests as an additional voice (the notes of which I then hid)
hoping to make all of the measures the same width, but that didn't fix
the issue.

Ideas on how to fix these issues are greatly appreciated.

Thanks,
Stef
%% http://lsr.di.unimi.it/LSR/Item?id=838

%LSR completed by P.P.Schneider on Feb. 2014 for v2.18

% These two lines are needed to force LilyPond to break only when
% YOU tell it to, via \break and \page Break. You may not need the page-break one.

%\layout {
%  \override Score.NonMusicalPaperColumn.line-break-permission = ##f
%  \override Score.NonMusicalPaperColumn.page-break-permission = ##f
%}

#(define ((bars-per-line-engraver bar-list) context)
  (let* ((working-copy bar-list)
         (total (1+ (car working-copy))))
    `((acknowledgers
       (paper-column-interface
        . ,(lambda (engraver grob source-engraver)
             (let ((internal-bar (ly:context-property context 'internalBarNumber)))
               (if (and (pair? working-copy)
                        (= (remainder internal-bar total) 0)
                        (eq? #t (ly:grob-property grob 'non-musical)))
                   (begin
                     (set! (ly:grob-property grob 'line-break-permission) 'force)
                     (if (null? (cdr working-copy))
                         (set! working-copy bar-list)
                         (begin
                           (set! working-copy (cdr working-copy))))
                           (set! total (+ total (car working-copy))))))))))))
						   
						   

% place inside a layout context like so:
%\score {
%  \layout {
%    \context {
%      \Score
%      %use the line below to insist on your layout
%      %\override NonMusicalPaperColumn.line-break-permission = ##f
%      \consists #(bars-per-line-engraver '(4))
%    }
%  }
%}
\include "bars-per-line-engraver.ily"

first = \drummode {
<<
  {
   \voiceOne
    cymr8 cymr8 
    \tuplet3/2{hh16 hh hh}
    hh8
    \tuplet3/2{tomh16 tomh tomh}
    \tuplet3/2{tomh16 tomh tomh}
    \tuplet3/2{tomh16 tomh tomh}
    tomh8
  }
  \\
  { \voiceTwo
	\repeat unfold 8 bd8
  }
>>
}

second = \drummode {
<<
  \voiceOne \repeat unfold 8 tomh8
  \\
  \voiceTwo \repeat unfold 8 bd8
>>
}

spacing = \drummode {
%  \hideNotes
  \override TupletBracket.bracket-visibility = ##f
  \override TupletNumber.text = #""
  \voiceThree
  \repeat unfold 8 {
    \repeat unfold 8 { \tuplet3/2{ tomh16 tomh tomh } }
  }
}

\score {
  \new DrumStaff {
    <<
      \new DrumVoice {
        \drummode {
            \repeat percent 4 { \first }
            \repeat percent 4 { \second }
        }
      }
%      \new DrumVoice { \spacing }
    >>
  }
  \layout {
    \context {
      \DrumStaff
      \remove Time_signature_engraver
    }
    \context {
      \DrumVoice
    }
    \context {
      \Score
      proportionalNotationDuration = #(ly:make-moment 1/30)
      \override SpacingSpanner.uniform-stretching = ##t

      \override NonMusicalPaperColumn.line-break-permission = ##f
      \consists #(bars-per-line-engraver '(4))
    }
  }
}

\paper {
  indent = 0
  left-margin = 5\mm
  line-width=#200
  ragged-right = ##f
  ragged-bottom = ##t
}

\version "2.18.2"

Attachment: horizontal-spacing-5.pdf
Description: Adobe PDF document

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to