Hi Stefano,

> Ideas on how to fix these issues are greatly appreciated.
Your pattern does not fit 4 times in a line. That's creating some of
your problems. To circumvent that you could switch between spacing
settings inside the notes as in the attached example.

For simplicity I've merged all files into one file.

Kind regards,
Michael
-- 
 Michael Gerdau       email: m...@qata.de
 GPG-keys available on request or at public keyserver
\version "2.18.2"

%% 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))
%    }
%  }
%}


%horizontal-spacing-5.ly

%\include "bars-per-line-engraver.ily"

first = \drummode {
      \set Score.proportionalNotationDuration = #(ly:make-moment 1/20)
      \override Score.SpacingSpanner.uniform-stretching = ##t
      \override Score.SpacingSpanner.strict-note-spacing = ##t
<<
  {
   \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
  }
>>
      \set Score.proportionalNotationDuration = #(ly:make-moment 1/4)
      \override Score.SpacingSpanner.uniform-stretching = ##f
      \override Score.SpacingSpanner.strict-note-spacing = ##f
}

second = \drummode {
      \set Score.proportionalNotationDuration = #(ly:make-moment 1/20)
      \override Score.SpacingSpanner.uniform-stretching = ##t
      \override Score.SpacingSpanner.strict-note-spacing = ##t
<<
  \voiceOne \repeat unfold 8 tomh8
  \\
  \voiceTwo \repeat unfold 8 bd8
>>
      \set Score.proportionalNotationDuration = #(ly:make-moment 1/4)
      \override Score.SpacingSpanner.uniform-stretching = ##f
      \override Score.SpacingSpanner.strict-note-spacing = ##f
}

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

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

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

Attachment: signature.asc
Description: OpenPGP digital signature

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

Reply via email to