Re: Dividing a measure with a dotted bar line

2015-01-17 Thread Thomas Morley
2015-01-17 18:32 GMT+01:00 Knute Snortum ksnor...@gmail.com:
 Thanks to everyone.  I think I have all the pieces now.


 Knute Snortum
 (via Gmail)



Hi,

I'm a little late to the party, though, below you'll find a more
generic suggestion to set intermediate BarLines.
Line-breaks are forbidden with this additional BarLine. It can be done
selective. The glyph for the bar can be chosen freely, as well as the
musical moment.

Limitations:
It has to be set for the current context.
Longer notes, continuing over the added bar will preserve printing the
additional BarLine.


\version 2.18.2

#(define (define-translator-property symbol type? description)
  (if (not (and (symbol? symbol)
(procedure? type?)
(string? description)))
  (ly:error error in call of define-translator-property))
  (if (not (equal? (object-property symbol 'translation-doc) #f))
  (ly:error (_ symbol ~S redefined) symbol))
  (set-object-property! symbol 'translation-type? type?)
  (set-object-property! symbol 'translation-doc description)
  symbol)

#(for-each
  (lambda (x)
(apply define-translator-property x))
  `(
(intermediate-bar-line
  ,boolean?
  Should an intermediate bar-line be printed?)))

#(define*
  ((intermediate-bar-line-engraver moment #:optional (glyph !)) context)
  
   inserts additional BarLines at @var{moment}
   a line-break there is forbidden
   the bar-line-glyph to insert @var{glyph} is made optional, default is \!\
   limitation: no intermediate BarLine is printed, if a longer note continues
  
   `(
 ;; Not sure if the following 'acknowledgers' is needed at all
 (acknowledgers
  (paper-column-interface
   . ,(lambda (engraver grob source-engraver)
(let ((internal-bar
(ly:context-property context 'internalBarNumber))
  (measurepos
(ly:context-property context 'measurePosition)))
(if (eq? moment (ly:moment-main measurepos))
(set! (ly:grob-property grob 'line-break-permission) '()))

 (process-music
  . ,(lambda (engraver)
   (let ((measurepos
   (ly:context-property context 'measurePosition))
 (intermediate-bar-line?
   (ly:context-property context 'intermediate-bar-line)))
 (if (and (= moment (ly:moment-main measurepos))
  intermediate-bar-line?)
 (let* ((event '())
(newgrob
  (ly:engraver-make-grob engraver 'BarLine event)))
   (set! (ly:grob-property newgrob 'glyph) glyph

#(define* (intermediateBars moment #:optional (glyph !))

 shortcut to insert the @code{intermediate-bar-line-engraver} into layout

  #{
\layout {
  \context {
\Staff
\consists #(intermediate-bar-line-engraver moment glyph)
  }
}
  #})

intermediateBarLineOff = \set Score.intermediate-bar-line = ##f
intermediateBarLineOn = \unset Score.intermediate-bar-line


%  EXAMPLES


\paper { ragged-last-bottom = ##f }

\header {
  title = \markup \column { intermediate-bar-line-engraver \vspace #2 }
}

\layout { \override TextScript.font-size = #-2 }

Noten = { \repeat unfold #7 { c2 c4 \break b b as g } }

annotation =
^\markup
\override #'(baseline-skip . 2)
\rounded-box
\column { Intermediate BarLine is unset in this bar. }

staff =
  \new Staff {
\compoundMeter #'((4 4) (3 4))
\set Timing.beamExceptions = #'()
\set Timing.beatStructure = #'(2 2 3)
\relative c'' {
  \Noten
  \intermediateBarLineOff
  \annotation
  \repeat unfold 14 c8
  \intermediateBarLineOn
  \Noten
  }
}

\score {
  \staff
  \layout { $(intermediateBars 4/4) }
  %% omitting \layout would work as well
  %$(intermediateBars 4/4)
  \header {
piece =
  \markup \bold
  Example 1, dashed BarLine after 4th quarter
  }
}

\score {
  \staff
  \layout { $(intermediateBars 3/4) }
  \header {
piece =
  \markup \bold
  Example 2, dashed BarLine after 3rd quarter
  }
}

\score {
  \staff
  \layout { $(intermediateBars 4/4 ||) }
  \header {
piece =
  \markup \bold
  Example 3, double BarLine after 4th quarter
  }
}

\score {
  \new Staff { \compoundMeter #'((4 4) (3 4)) c2.~ c1 c2.~ c1 }
  \layout { $(intermediateBars 4/4 ||) }
  \header {
piece =
  \markup \bold
  Example 4, Limitation: no intermediate BarLine is printed,
if a longer note continues.
  }
}


HTH,
  Harm

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


Re: Dividing a measure with a dotted bar line

2015-01-17 Thread Thomas Morley
2015-01-17 20:41 GMT+01:00 David Nalesnik david.nales...@gmail.com:
 Kieren,

 On Sat, Jan 17, 2015 at 1:38 PM, Kieren MacMillan
 kieren_macmil...@sympatico.ca wrote:

 Hi Harm,

 As always, an awesome answer!  =)

 One thing: when I compile it (2.19.15), I get a ton of

 warning: forced break was overridden by some other event, should you
 be using bar checks?

 Is that expected?


 Removing the \break from the definition of Noten will get rid of them.

 --David

I inserted the break for final testings, should have removed it.

Sorry,
  Harm

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


Re: Dividing a measure with a dotted bar line

2015-01-17 Thread Kieren MacMillan
Hi Harm,

As always, an awesome answer!  =)

One thing: when I compile it (2.19.15), I get a ton of

warning: forced break was overridden by some other event, should you be 
using bar checks?

Is that expected?

Thanks,
Kieren.
___

Kieren MacMillan, composer
www:  http://www.kierenmacmillan.info
email:  i...@kierenmacmillan.info
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Dividing a measure with a dotted bar line

2015-01-17 Thread David Nalesnik
Kieren,

On Sat, Jan 17, 2015 at 1:38 PM, Kieren MacMillan 
kieren_macmil...@sympatico.ca wrote:

 Hi Harm,

 As always, an awesome answer!  =)

 One thing: when I compile it (2.19.15), I get a ton of

 warning: forced break was overridden by some other event, should you
 be using bar checks?

 Is that expected?


Removing the \break from the definition of Noten will get rid of them.

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


Re: Dividing a measure with a dotted bar line

2015-01-17 Thread Knute Snortum
Thanks Kevin, that solves the bar line problem.  Any ideas for the time
signatures?


Knute Snortum
(via Gmail)

On Sat, Jan 17, 2015 at 8:29 AM, Kevin Barry barr...@gmail.com wrote:

 Dear Knute,

 If I understand what you want correctly, you can simply insert the barline
 by adding:
 \bar ; at the appropriate moment, e.g.:

 \version 2.18.2

 \relative {
   \time 5/4
   b b b \bar ; b b
 }

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


Re: Dividing a measure with a dotted bar line

2015-01-17 Thread Urs Liska
What about adding a Dynamics context and change that to print the time 
signature?
Then parenthesize that and display the time sigs in the visible staves 
as 3/4.


Can't try this out currently so I don't know if it works.

But in any case I think you should use a real 5/4 time signature and add 
the rest.


HTH
Urs

Am 17.01.2015 um 17:22 schrieb Knute Snortum:

I have a prelude I'm transcribing that's got a lot of challenges right
in the first bar.  I looks like this:


​So far what I have is this:


​(The minimal lilypond file is at the end.)

What I don't have is the barline between the third and fourth beat, the
parenthesized time signature lowered, and a (fake?) time signature of
3/4  (or do use 3/4 and 2/4 measures and fake the 5/4?)  The time
signature is just at the beginning of the piece; the dotted barline will
show up several times.  Here's the lilypond source file:

%%% -- Begin
\version 2.19.15
\language english

timeSigParenth = \once \override Staff.TimeSignature.stencil =
   #(lambda (grob) (parenthesize-stencil
   (ly:time-signature::print grob) 0.1 0.4 0.4 0.1 ))

upperStaffTop = \relative c' {
   \timeSigParenth \time 5/4
   \oneVoice r4
   \voiceOne e e'8 ( a a' bf d e bf'4 e, e' )
   \oneVoice r |
}

upperStaffBottom = \relative c'' {
   s4 a cs4 s2. |
}

lowerStaffTop = \relative c' {
   r4 a cs d e g e, r |
}

lowerStaffBottom = \relative c, {
   a4-. e''8 ( a bf4 e, ) e,-. ( |
   a,4-. )
}

dynamics = {
   \tempo Modéré 4 = 84
   s4 \pp s s \ s \! s |
}

%% --- Boilerplate

upperStaff = {
   \clef treble
   \key a \major
   
 \new Voice { \voiceOne \upperStaffTop }
 \new Voice { \voiceTwo \upperStaffBottom }
   
}

lowerStaff = {
   \clef bass
   \key a \major
   
 \new Voice { \voiceThree \lowerStaffTop }
 \new Voice { \voiceFour \lowerStaffBottom }
   
}

\score {
   \removeWithTag #'played
   \new PianoStaff 
 \new Staff = upper { \upperStaff }
 \new Dynamics = dyns { \dynamics }
 \new Staff = lower { \lowerStaff }
   
   \layout {
   }
}
%%% -- End

Knute Snortum
(via Gmail)


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




--
Urs Liska
www.openlilylib.org

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


Re: Dividing a measure with a dotted bar line

2015-01-17 Thread Kieren MacMillan
Hi Knute,

 What I don't have is the barline between the third and fourth beat, the 
 parenthesized time signature lowered, and a (fake?) time signature of 3/4  
 (or do use 3/4 and 2/4 measures and fake the 5/4?)  The time signature is 
 just at the beginning of the piece; the dotted barline will show up several 
 times.

Below is a modified snippet showing one possible solution to some of the issues 
you are facing.
Notice also that I moved shared information to a global variable — makes it 
much easier to maintain (IMO).
I would probably just add the parenthesized time signature as a markup in the 
Dynamics context (though there are other ways of making it happen).

Hope this helps!
Kieren.
__

\version 2.19.15
\language english

global = {
  \tempo Modéré 4 = 84
  \key a \major
  \time 5/4
  \set Staff.timeSignatureFraction = 3/4
  s2. \bar ! s2
}

upperStaffTop = \relative c' {
  \oneVoice r4
  \voiceOne e e'8 ( a a' bf d e bf'4 e, e' ) 
  \oneVoice r |
}

upperStaffBottom = \relative c'' {
  s4 a cs4 s2. |
}

lowerStaffTop = \relative c' {
  r4 a cs d e g e, r |
}

lowerStaffBottom = \relative c, {
  a4-. e''8 ( a bf4 e, ) e,-. ( |
  a,4-. )
}

dynamics = {
  s4 s -\tweak #'X-offset #-4 \pp s16 s8. -\tweak #'to-barline ##f \ s2\!   |
}

%% --- Boilerplate

upperStaff = {
  \clef treble
  
\global
\new Voice { \voiceOne \upperStaffTop }
\new Voice { \voiceTwo \upperStaffBottom }
  
}

lowerStaff = {
  \clef bass
  
\global
\new Voice { \voiceThree \lowerStaffTop }
\new Voice { \voiceFour \lowerStaffBottom }
  
}

\score {
  \removeWithTag #'played
  \new PianoStaff 
\new Staff = upper { \upperStaff }
\new Dynamics = dyns { \dynamics }
\new Staff = lower { \lowerStaff } 
  
  \layout {
  }
}
%%% -- End

___

Kieren MacMillan, composer
www:  http://www.kierenmacmillan.info
email:  i...@kierenmacmillan.info


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


Re: Dividing a measure with a dotted bar line

2015-01-17 Thread Kevin Barry

 Any ideas for the time signatures?


As others have suggested you can place it in markup in its own dynamics
context between the staves like this (it's not an elegant solution, but you
only need to do it once):

\version 2.18.2

fakeThreeFour = {
  \override Score.TimeSignature #'stencil = #ly:text-interface::print
  \override Score.TimeSignature #'text = \markup {
\override #'(baseline-skip . 0) \column { \number 3 \number 4 }
  }
}

parenFiveFour = \markup {
  \concat \normal-text { \fontsize #5 \lower #1.25 (
\override #'(baseline-skip . 0) \column { \number 5 \number 4 }
\fontsize #5 \lower #1.25 )
  }
}

\new PianoStaff 
  \new Staff {
\time 5/4 \fakeThreeFour
b b b \bar ! b b
  }
  \new Dynamics {
s -\tweak X-offset #-5 -\markup { \parenFiveFour }
  }
  \new Staff {
\clef bass
b b b b b
  }

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


Re: Dividing a measure with a dotted bar line

2015-01-17 Thread Knute Snortum
Thanks to everyone.  I think I have all the pieces now.


Knute Snortum
(via Gmail)

On Sat, Jan 17, 2015 at 9:06 AM, Kevin Barry barr...@gmail.com wrote:

 Any ideas for the time signatures?


 As others have suggested you can place it in markup in its own dynamics
 context between the staves like this (it's not an elegant solution, but you
 only need to do it once):

 \version 2.18.2

 fakeThreeFour = {
   \override Score.TimeSignature #'stencil = #ly:text-interface::print
   \override Score.TimeSignature #'text = \markup {
 \override #'(baseline-skip . 0) \column { \number 3 \number 4 }
   }
 }

 parenFiveFour = \markup {
   \concat \normal-text { \fontsize #5 \lower #1.25 (
 \override #'(baseline-skip . 0) \column { \number 5 \number 4 }
 \fontsize #5 \lower #1.25 )
   }
 }

 \new PianoStaff 
   \new Staff {
 \time 5/4 \fakeThreeFour
 b b b \bar ! b b
   }
   \new Dynamics {
 s -\tweak X-offset #-5 -\markup { \parenFiveFour }
   }
   \new Staff {
 \clef bass
 b b b b b
   }
 

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