Re:changing symbols used by Measure_grouping_engraver

2018-08-03 Thread Flaming Hakama by Elaine
>
> -- Forwarded message --
> From: Flaming Hakama by Elaine 
> To: Lilypond-User Mailing List 
> Date: Fri, 3 Aug 2018 13:50:32 -0700
> Subject: Re:changing symbols used by Measure_grouping_engraver
>
>

> We have a winner!
>
>
> Thanks you, this works perfectly.
>
> Much appreciated.
>
>
> Sincerely,
>
> Elaine Alt
>


\version "2.19.82"

%{

To follow up after playing around with this,
there are a few things that might be useful to point out.
I wonder if such an example should be included in the docs?


One is that the grouping symbol is only printed when there is a note/rest
on the beat.
For dotted halfs in compound time, for example, only one beat is shown.
This is easy enough to fix by paralleling in some spacers that show all the
beats.

But is there a setting that would do this automatically?


The other thing is that they are not printed on the same y axis.
This can be consisted [sic] by moving them to their own staff.
But then, you need to adjust the staff spacing to get them close enough.

%}

#(define triangle->vertical-line-stencil
  (lambda (grob)
(let* ((style (ly:grob-property grob 'style))
   (thickness (ly:grob-property grob 'thickness))
   (staff-line-thick (ly:staff-symbol-line-thickness grob))
   (thick (* thickness staff-line-thick))
   (height (ly:grob-property grob 'height)))
(if (eq? style 'triangle)
(make-line-stencil
  thick ;width
  ;; 0.5 is my choice, probably catch NoteColumn and take half of
  ;; its extent
  0.5 ;startx
  0 ;starty
  0.5  ;endx
  height ;endy
  )
ly:measure-grouping::print

global = {
\time 15/8
\set Timing.beatStructure = 3,3,3,3,3
s1*15/8
}

beatPattern = \relative c' {
\override Staff.MeasureGrouping.stencil =
#triangle->vertical-line-stencil
s4. s s s s
}

music = \relative c' {
c8 ( e g )  c8 ( e g )  c8 ( e g )  g,2.
}


%  This one successfully uses the #triangle->vertical-line-stencil
%  But it doesn't show all beats
%  And the grouping marks are not on the same vertical line
\score {
<<
\new Staff {
<<
\global
\override Staff.MeasureGrouping.stencil =
#triangle->vertical-line-stencil
\music
>>
}
>>
\layout {
\context {
\Staff
\consists "Measure_grouping_engraver"
}
}
}



%  Showing all beats by including a spacer subdivision
%  Getting consistent vertical alignment by including the grouper on a new
rhythmic staff
%  But the beat symbols are too far away.
\score {
<<
\new RhythmicStaff {
<<
\global
\beatPattern
>>
}
\new Staff {
<<
\global
\music
>>
}
>>
\layout {
\context {
\RhythmicStaff
\remove "Time_signature_engraver"
\remove "Clef_engraver"
\override BarLine.transparent = ##t
\override StaffSymbol.line-count = #0
\consists "Measure_grouping_engraver"
}
}
}



%  Showing all beats by including a spacer subdivision
%  Getting consistent vertical alignment by including the grouper on a new
rhythmic staff
%  And then moving it closer to the music staff by setting
staff-staff-spacing.
\score {
<<
\new RhythmicStaff \with {
\override VerticalAxisGroup.staff-staff-spacing.basic-distance
= #4
} {
<<
\global
\beatPattern
>>
}
\new Staff {
<<
\global
\music
>>
}
>>
\layout {
\context {
\RhythmicStaff
\remove "Time_signature_engraver"
\remove "Clef_engraver"
\override BarLine.transparent = ##t
\override StaffSymbol.line-count = #0
\consists "Measure_grouping_engraver"
}
}
}


Please let me know if you think the docs could benefit from such an
example,
or at least mentioning the behavior about long notes, and vertical
alignment.



Thanks,

Elaine Alt
415 . 341 .4954   "*Confusion is
highly underrated*"
ela...@flaminghakama.com
Producer ~ Composer ~ Instrumentalist
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: partcombine for choir and piano?

2018-08-03 Thread Noeck
Thanks a lot, Simon. I will need some time to digest and test those
settings. It will certainly be very helpful.

Best,
Joram

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


Re: New snippet: remove staff if another is alive (for wind divisi)

2018-08-03 Thread Saul Tobin
Those errors are from this expression in the three staff example: <<
\global \I \II \III >>. Lilypond is implicitly creating three Voices
instead of treating it as a single Voice with simultaneous music. If you
replace that expression with { <> << \global \I \II \III >> }, the errors
go away.

Since the partcombiner doesn't currently support more than 2 arguments,
this is something that requires a workaround if you want to do three parts
on a single staff.

Anyway, it doesn't affect the point of this snippet, which is automatically
hiding staves based on which other staves are alive on each system.

On Fri, Aug 3, 2018 at 2:23 PM Ben  wrote:

> On 8/3/2018 5:14 PM, Saul Tobin wrote:
>
> Hi all,
>
> I just put together a snippet to make managing shared wind staves more
> automatic, particularly with triple winds that may be combined in different
> ways.
>
> \version "2.19.82"
>
> #(define remove-if-sibling
>(lambda (offsets)
>  (lambda (grob)
>(let* (
>;; The parent of a VerticalAxisGroup is a VerticalAlignment
>(parent (ly:grob-parent grob 1))
>;; Get the children VerticalAxisGroups of the parent
>(siblings (ly:grob-object parent 'elements))
>(siblings-list
> (if (ly:grob-array? siblings)
> (ly:grob-array->list siblings)
> '()))
>;; Find the siblings above or below me by offsets
>(my-vindex (ly:grob-get-vertical-axis-group-index grob))
>(enemy-indices (map (lambda (offset) (+ offset my-vindex))
> offsets))
>(enemy-vaxis? (lambda (v) (member
> (ly:grob-get-vertical-axis-group-index v)
>enemy-indices)))
>(enemy-vaxes
> (filter enemy-vaxis? siblings-list))
>)
>  ;; Suicide if an enemy sibling is alive
>  (map
>   (lambda (enemy-vaxis)
> (ly:pointer-group-interface::add-grob grob 'make-dead-when
> enemy-vaxis))
>   enemy-vaxes)
>  )
>)
>  )
>)
>
> %% Two Staff Example
>
> global = {
>   s1
>   \break
>   s1
>   \break
>   s1*2
> }
>
> I = {
>   c'''1
>   \context Staff = "1" { \set Staff.keepAliveInterfaces = #'() }
>   c'''1
>   c'''1
>   \context Staff = "1" { \unset Staff.keepAliveInterfaces }
>   c'''1
> }
>
> II = {
>   e''1
>   e''1
>   e''1
>   e''1
> }
>
> <<
>   \new Staff = "1+2" \with {
> \override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
> '(1))
> \override VerticalAxisGroup.remove-empty = ##t
> \override VerticalAxisGroup.remove-first = ##t
>   } << \global \partcombine \I \II >>
>   \new Staff = "1" \with {
> \override VerticalAxisGroup.remove-empty = ##t
> \override VerticalAxisGroup.remove-first = ##t
>   } << \global \I >>
>   \new Staff = "2" \with {
> \override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
> '(-2))
> \override VerticalAxisGroup.remove-empty = ##t
> \override VerticalAxisGroup.remove-first = ##t
>   } << \global \II >>
> >>
>
> %% Three Staff Example
>
> global = {
>   s1
>   \break
>   s1
>   \break
>   s1
>   \break
>   s1*2
> }
>
> I = {
>   c'''1
>   \context Staff = "1" { \set Staff.keepAliveInterfaces = #'() }
>   c'''1
>   c'''1
>   c'''1
>   \context Staff = "1" { \unset Staff.keepAliveInterfaces }
>   c'''1
> }
>
> II = {
>   e''1
>   e''1
>   e''1
>   e''1
>   e''1
> }
>
> III = {
>   a'1
>   a'1
>   \context Staff = "3" { \set Staff.keepAliveInterfaces = #'() }
>   a'1
>   a'1
>   a'1
> }
>
> <<
>   \new Staff = "1+2+3" \with {
> \override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
> '(2 5))
> \override VerticalAxisGroup.remove-empty = ##t
> \override VerticalAxisGroup.remove-first = ##t
>   } << \global \I \II \III >>
>   \new Staff = "1+2" \with {
> \override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
> '(1 -1))
> \override VerticalAxisGroup.remove-empty = ##t
> \override VerticalAxisGroup.remove-first = ##t
>   } << \global \partcombine \I \II >>
>   \new Staff = "1" \with {
> \override VerticalAxisGroup.remove-empty = ##t
> \override VerticalAxisGroup.remove-first = ##t
>   } << \global \I >>
>   \new Staff = "2+3" \with {
> \override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
> '(2 -3))
> \override VerticalAxisGroup.remove-empty = ##t
> \override VerticalAxisGroup.remove-first = ##t
>   } << \global \partcombine \II \III >>
>   \new Staff = "2" \with {
> \override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
> '(-1 -3 -4))
> \override VerticalAxisGroup.remove-empty = ##t
> \override VerticalAxisGroup.remove-first = ##t
>   } << \global \II >>
>   \new Staff = "3" \with {
> \override VerticalAxisGroup.remove-empty = ##t
> \override VerticalAxisGroup.remove-first = ##t
>   } << \global \III >>
> 

Re: New snippet: remove staff if another is alive (for wind divisi)

2018-08-03 Thread Ben

On 8/3/2018 5:14 PM, Saul Tobin wrote:

Hi all,

I just put together a snippet to make managing shared wind staves more 
automatic, particularly with triple winds that may be combined in 
different ways.


\version "2.19.82"

#(define remove-if-sibling
   (lambda (offsets)
     (lambda (grob)
       (let* (
               ;; The parent of a VerticalAxisGroup is a VerticalAlignment
               (parent (ly:grob-parent grob 1))
               ;; Get the children VerticalAxisGroups of the parent
               (siblings (ly:grob-object parent 'elements))
               (siblings-list
                (if (ly:grob-array? siblings)
                    (ly:grob-array->list siblings)
                    '()))
               ;; Find the siblings above or below me by offsets
               (my-vindex (ly:grob-get-vertical-axis-group-index grob))
               (enemy-indices (map (lambda (offset) (+ offset 
my-vindex)) offsets))
               (enemy-vaxis? (lambda (v) (member 
(ly:grob-get-vertical-axis-group-index v)

 enemy-indices)))
               (enemy-vaxes
                (filter enemy-vaxis? siblings-list))
               )
         ;; Suicide if an enemy sibling is alive
         (map
          (lambda (enemy-vaxis)
            (ly:pointer-group-interface::add-grob grob 'make-dead-when 
enemy-vaxis))

          enemy-vaxes)
         )
       )
     )
   )

%% Two Staff Example

global = {
  s1
  \break
  s1
  \break
  s1*2
}

I = {
  c'''1
  \context Staff = "1" { \set Staff.keepAliveInterfaces = #'() }
  c'''1
  c'''1
  \context Staff = "1" { \unset Staff.keepAliveInterfaces }
  c'''1
}

II = {
  e''1
  e''1
  e''1
  e''1
}

<<
  \new Staff = "1+2" \with {
    \override VerticalAxisGroup.before-line-breaking = 
#(remove-if-sibling '(1))

    \override VerticalAxisGroup.remove-empty = ##t
    \override VerticalAxisGroup.remove-first = ##t
  } << \global \partcombine \I \II >>
  \new Staff = "1" \with {
    \override VerticalAxisGroup.remove-empty = ##t
    \override VerticalAxisGroup.remove-first = ##t
  } << \global \I >>
  \new Staff = "2" \with {
    \override VerticalAxisGroup.before-line-breaking = 
#(remove-if-sibling '(-2))

    \override VerticalAxisGroup.remove-empty = ##t
    \override VerticalAxisGroup.remove-first = ##t
  } << \global \II >>
>>

%% Three Staff Example

global = {
  s1
  \break
  s1
  \break
  s1
  \break
  s1*2
}

I = {
  c'''1
  \context Staff = "1" { \set Staff.keepAliveInterfaces = #'() }
  c'''1
  c'''1
  c'''1
  \context Staff = "1" { \unset Staff.keepAliveInterfaces }
  c'''1
}

II = {
  e''1
  e''1
  e''1
  e''1
  e''1
}

III = {
  a'1
  a'1
  \context Staff = "3" { \set Staff.keepAliveInterfaces = #'() }
  a'1
  a'1
  a'1
}

<<
  \new Staff = "1+2+3" \with {
    \override VerticalAxisGroup.before-line-breaking = 
#(remove-if-sibling '(2 5))

    \override VerticalAxisGroup.remove-empty = ##t
    \override VerticalAxisGroup.remove-first = ##t
  } << \global \I \II \III >>
  \new Staff = "1+2" \with {
    \override VerticalAxisGroup.before-line-breaking = 
#(remove-if-sibling '(1 -1))

    \override VerticalAxisGroup.remove-empty = ##t
    \override VerticalAxisGroup.remove-first = ##t
  } << \global \partcombine \I \II >>
  \new Staff = "1" \with {
    \override VerticalAxisGroup.remove-empty = ##t
    \override VerticalAxisGroup.remove-first = ##t
  } << \global \I >>
  \new Staff = "2+3" \with {
    \override VerticalAxisGroup.before-line-breaking = 
#(remove-if-sibling '(2 -3))

    \override VerticalAxisGroup.remove-empty = ##t
    \override VerticalAxisGroup.remove-first = ##t
  } << \global \partcombine \II \III >>
  \new Staff = "2" \with {
    \override VerticalAxisGroup.before-line-breaking = 
#(remove-if-sibling '(-1 -3 -4))

    \override VerticalAxisGroup.remove-empty = ##t
    \override VerticalAxisGroup.remove-first = ##t
  } << \global \II >>
  \new Staff = "3" \with {
    \override VerticalAxisGroup.remove-empty = ##t
    \override VerticalAxisGroup.remove-first = ##t
  } << \global \III >>
>>



Hello,

Thanks for sharing this with us! One question...

When I just copy and paste your snippet into Frescobaldi as is, I get a 
few errors.  ?


=

Interpreting music...

Interpreting music...

Interpreting music...

Interpreting music...

Interpreting music...

Preprocessing graphical objects...

Interpreting music...

Preprocessing graphical objects...


document.ly:103:3: warning: this Voice needs a \voiceXx or \shiftXx setting

e''1


document.ly:102:3: warning: this Voice needs a \voiceXx or \shiftXx setting

e''1


document.ly:101:3: warning: this Voice needs a \voiceXx or \shiftXx setting

e''1


document.ly:100:3: warning: this Voice needs a \voiceXx or \shiftXx setting

e''1


document.ly:99:3: warning: this Voice needs a \voiceXx or \shiftXx setting

e''1


Finding the ideal number of pages...

Fitting music on 1 page...

Drawing systems...

Layout output to `./tmp-lilypond-BWUill'...

Converting to `document.pdf'...

Deleting 

New snippet: remove staff if another is alive (for wind divisi)

2018-08-03 Thread Saul Tobin
Hi all,

I just put together a snippet to make managing shared wind staves more
automatic, particularly with triple winds that may be combined in different
ways.

\version "2.19.82"

#(define remove-if-sibling
   (lambda (offsets)
 (lambda (grob)
   (let* (
   ;; The parent of a VerticalAxisGroup is a VerticalAlignment
   (parent (ly:grob-parent grob 1))
   ;; Get the children VerticalAxisGroups of the parent
   (siblings (ly:grob-object parent 'elements))
   (siblings-list
(if (ly:grob-array? siblings)
(ly:grob-array->list siblings)
'()))
   ;; Find the siblings above or below me by offsets
   (my-vindex (ly:grob-get-vertical-axis-group-index grob))
   (enemy-indices (map (lambda (offset) (+ offset my-vindex))
offsets))
   (enemy-vaxis? (lambda (v) (member
(ly:grob-get-vertical-axis-group-index v)
   enemy-indices)))
   (enemy-vaxes
(filter enemy-vaxis? siblings-list))
   )
 ;; Suicide if an enemy sibling is alive
 (map
  (lambda (enemy-vaxis)
(ly:pointer-group-interface::add-grob grob 'make-dead-when
enemy-vaxis))
  enemy-vaxes)
 )
   )
 )
   )

%% Two Staff Example

global = {
  s1
  \break
  s1
  \break
  s1*2
}

I = {
  c'''1
  \context Staff = "1" { \set Staff.keepAliveInterfaces = #'() }
  c'''1
  c'''1
  \context Staff = "1" { \unset Staff.keepAliveInterfaces }
  c'''1
}

II = {
  e''1
  e''1
  e''1
  e''1
}

<<
  \new Staff = "1+2" \with {
\override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
'(1))
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
  } << \global \partcombine \I \II >>
  \new Staff = "1" \with {
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
  } << \global \I >>
  \new Staff = "2" \with {
\override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
'(-2))
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
  } << \global \II >>
>>

%% Three Staff Example

global = {
  s1
  \break
  s1
  \break
  s1
  \break
  s1*2
}

I = {
  c'''1
  \context Staff = "1" { \set Staff.keepAliveInterfaces = #'() }
  c'''1
  c'''1
  c'''1
  \context Staff = "1" { \unset Staff.keepAliveInterfaces }
  c'''1
}

II = {
  e''1
  e''1
  e''1
  e''1
  e''1
}

III = {
  a'1
  a'1
  \context Staff = "3" { \set Staff.keepAliveInterfaces = #'() }
  a'1
  a'1
  a'1
}

<<
  \new Staff = "1+2+3" \with {
\override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
'(2 5))
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
  } << \global \I \II \III >>
  \new Staff = "1+2" \with {
\override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
'(1 -1))
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
  } << \global \partcombine \I \II >>
  \new Staff = "1" \with {
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
  } << \global \I >>
  \new Staff = "2+3" \with {
\override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
'(2 -3))
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
  } << \global \partcombine \II \III >>
  \new Staff = "2" \with {
\override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
'(-1 -3 -4))
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
  } << \global \II >>
  \new Staff = "3" \with {
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
  } << \global \III >>
>>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re:changing symbols used by Measure_grouping_engraver

2018-08-03 Thread Flaming Hakama by Elaine
> -- Forwarded message --
> From: Thomas Morley 
> Date: Fri, 3 Aug 2018 13:17:54 +0200
> Subject: Re: changing symbols used by Measure_grouping_engraver
> 2018-08-03 12:25 GMT+02:00 Torsten Hämmerle :
> > Flaming Hakama by Elaine wrote
> >> In particular, how to change the symbol used to denote the dotted 8th
> >> value
> >> in compund time:
> >> instead of a triangle, how do I get a vertical bar (or slash)?
> >
>


>
> Here my own attempts: slashes, vertical lines and (just for fun)
> tie-style stencils replacing the triangles
>
> \version "2.19.82"
>
> #(define triangle->slash-stencil
>   (lambda (grob)
> (let* ((style (ly:grob-property grob 'style))
>(thickness (ly:grob-property grob 'thickness))
>(staff-line-thick (ly:staff-symbol-line-thickness grob))
>(thick (* thickness staff-line-thick))
>(stil (ly:measure-grouping::print grob))
>(stil-x-ext (ly:stencil-extent stil X))
>(height (ly:grob-property grob 'height)))
> (if (eq? style 'triangle)
> (make-line-stencil
>   thick ;width
>   (car stil-x-ext) ;startx
>   0 ;starty
>   (cdr stil-x-ext)  ;endx
>   height ;endy
>   )
> stil
>
> #(define triangle->vertical-line-stencil
>   (lambda (grob)
> (let* ((style (ly:grob-property grob 'style))
>(thickness (ly:grob-property grob 'thickness))
>(staff-line-thick (ly:staff-symbol-line-thickness grob))
>(thick (* thickness staff-line-thick))
>(height (ly:grob-property grob 'height)))
> (if (eq? style 'triangle)
> (make-line-stencil
>   thick ;width
>   ;; 0.5 is my choice, probably catch NoteColumn and take half of
>   ;; its extent
>   0.5 ;startx
>   0 ;starty
>   0.5  ;endx
>   height ;endy
>   )
> ly:measure-grouping::print
>
>
> #(define triangle->tie-stencil
>   (lambda (grob)
> (let* ((style (ly:grob-property grob 'style))
>(stil (ly:measure-grouping::print grob))
>(stil-x-ext (ly:stencil-extent stil X))
>(length-x (- (cdr stil-x-ext) (car stil-x-ext)))
>(height (ly:grob-property grob 'height)))
> (if (eq? style 'triangle)
> (begin
>   (ly:grob-set-property! grob 'control-points
> (list
>   (cons 0 0)
>   (cons (* 1/3 length-x) height)
>   (cons (* 2/3 length-x) height)
>   (cons length-x 0)))
>   (ly:tie::print grob))
> ly:measure-grouping::print
>
> mus =
> \relative c'' {
>   \time 9/8
>   g8 g d d g g a( bes g) |
>   \set Timing.beatStructure = 2,2,2,3
>   g8 g d d g g a( bes g) |
>   \time 4,5 9/8
>   g8 g d d g g a( bes g) |
>   \time 5/8
>   a4. g4 |
>   \set Timing.beatStructure = 3,3,3
> }
>
> \score {
>   \new Voice
> {
>   \override Staff.MeasureGrouping.stencil =
> #triangle->vertical-line-stencil
>   \mus
>   \break
>   \override Staff.MeasureGrouping.stencil = #triangle->slash-stencil
>   \mus
>   \break
>   \override Staff.MeasureGrouping.stencil = #triangle->tie-stencil
>   \mus
> }
>   \layout {
> \context {
>   \Staff
>   \consists "Measure_grouping_engraver"
> }
>   }
> }
>
> All the best,
>   Harm
>
>
Ding!
Ding!
Ding!

We have a winner!


Thanks you, this works perfectly.

Much appreciated.


Sincerely,

Elaine Alt
415 . 341 .4954   "*Confusion is
highly underrated*"
ela...@flaminghakama.com
Producer ~ Composer ~ Instrumentalist
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: changing symbols used by Measure_grouping_engraver

2018-08-03 Thread Thomas Morley
2018-08-03 13:17 GMT+02:00 Thomas Morley :

>   \layout {
> \context {
>   \Staff
>   \consists "Measure_grouping_engraver"
> }
>   }
> }

While playing with it I noticed some issues. I just wrote a bug report
about them:
http://lilypond.1069038.n5.nabble.com/Two-issue-with-Measure-grouping-engraver-td215297.html

Cheers,
  Harm

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


Re: changing symbols used by Measure_grouping_engraver

2018-08-03 Thread Thomas Morley
2018-08-03 13:33 GMT+02:00 Torsten Hämmerle :
> Thomas Morley-2 wrote
>> Hi Torsten,
>>
>> iiuc, this will result in a _horizontal_ line, not vertical. ;)
>
>
> Drat, this tiny detail makes my simplistic attempt rather useless.
>
> Lame excuse: "No, this is not a horizontal line, it's actually a vertical
> line, just very thick and very short". ;)


rofl

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


Re: changing symbols used by Measure_grouping_engraver

2018-08-03 Thread Torsten Hämmerle
Thomas Morley-2 wrote
> Hi Torsten,
> 
> iiuc, this will result in a _horizontal_ line, not vertical. ;)


Drat, this tiny detail makes my simplistic attempt rather useless.

Lame excuse: "No, this is not a horizontal line, it's actually a vertical
line, just very thick and very short". ;)

But, as usual, your elaborate solution leaves nothing to be desired.

Thanks,
Torsten



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

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


Re: changing symbols used by Measure_grouping_engraver

2018-08-03 Thread Thomas Morley
2018-08-03 12:25 GMT+02:00 Torsten Hämmerle :
> Flaming Hakama by Elaine wrote
>> In particular, how to change the symbol used to denote the dotted 8th
>> value
>> in compund time:
>> instead of a triangle, how do I get a vertical bar (or slash)?
>
> Hi Elaine,
>
> The two options "triangle" and "bracket" are pretty much hardcoded.
> But you can set the height (thus squeezing both forms into a vertical line
> when you set height to 0) and thickness (to make this line as thick as you
> like):
>
>   \override Staff.MeasureGrouping.height = 0
>
> That way, you'll get a vertical line (unfortunately the bracket will be
> indistinguishable then from the triangle).
>
> But you might define a custom stencil quite easily that sets the height to 0
> if style is #'triangle and then calls the original print stencil.
> In the following example, I've used the original snipped coding as a basis,
> because in your example, there were no brackets at all.
>
> %%%
> \version "2.19.81"
>
> #(define (custom-grouping-stencil grob)
>(let ((style (ly:grob-property grob 'style)))
>  (if (eq? style 'triangle)
>  (ly:grob-set-property! grob 'height 0))
>  ly:measure-grouping::print))
>
> \score {
>   \new Voice \relative c'' {
> \time 9/8
> g8 g d d g g a( bes g) |
> \set Timing.beatStructure = 2,2,2,3
> g8 g d d g g a( bes g) |
> \time 4,5 9/8
> g8 g d d g g a( bes g) |
> \time 5/8
> a4. g4 |
>   }
>   \layout {
> \context {
>   \Staff
>   \consists "Measure_grouping_engraver"
>   \override MeasureGrouping.stencil = #custom-grouping-stencil
> }
>   }
> }
> %%%
>
> 
>
> HTH,
> Torsten


Hi Torsten,

iiuc, this will result in a _horizontal_ line, not vertical. ;)

Here my own attempts: slashes, vertical lines and (just for fun)
tie-style stencils replacing the triangles

\version "2.19.82"

#(define triangle->slash-stencil
  (lambda (grob)
(let* ((style (ly:grob-property grob 'style))
   (thickness (ly:grob-property grob 'thickness))
   (staff-line-thick (ly:staff-symbol-line-thickness grob))
   (thick (* thickness staff-line-thick))
   (stil (ly:measure-grouping::print grob))
   (stil-x-ext (ly:stencil-extent stil X))
   (height (ly:grob-property grob 'height)))
(if (eq? style 'triangle)
(make-line-stencil
  thick ;width
  (car stil-x-ext) ;startx
  0 ;starty
  (cdr stil-x-ext)  ;endx
  height ;endy
  )
stil

#(define triangle->vertical-line-stencil
  (lambda (grob)
(let* ((style (ly:grob-property grob 'style))
   (thickness (ly:grob-property grob 'thickness))
   (staff-line-thick (ly:staff-symbol-line-thickness grob))
   (thick (* thickness staff-line-thick))
   (height (ly:grob-property grob 'height)))
(if (eq? style 'triangle)
(make-line-stencil
  thick ;width
  ;; 0.5 is my choice, probably catch NoteColumn and take half of
  ;; its extent
  0.5 ;startx
  0 ;starty
  0.5  ;endx
  height ;endy
  )
ly:measure-grouping::print


#(define triangle->tie-stencil
  (lambda (grob)
(let* ((style (ly:grob-property grob 'style))
   (stil (ly:measure-grouping::print grob))
   (stil-x-ext (ly:stencil-extent stil X))
   (length-x (- (cdr stil-x-ext) (car stil-x-ext)))
   (height (ly:grob-property grob 'height)))
(if (eq? style 'triangle)
(begin
  (ly:grob-set-property! grob 'control-points
(list
  (cons 0 0)
  (cons (* 1/3 length-x) height)
  (cons (* 2/3 length-x) height)
  (cons length-x 0)))
  (ly:tie::print grob))
ly:measure-grouping::print

mus =
\relative c'' {
  \time 9/8
  g8 g d d g g a( bes g) |
  \set Timing.beatStructure = 2,2,2,3
  g8 g d d g g a( bes g) |
  \time 4,5 9/8
  g8 g d d g g a( bes g) |
  \time 5/8
  a4. g4 |
  \set Timing.beatStructure = 3,3,3
}

\score {
  \new Voice
{
  \override Staff.MeasureGrouping.stencil = #triangle->vertical-line-stencil
  \mus
  \break
  \override Staff.MeasureGrouping.stencil = #triangle->slash-stencil
  \mus
  \break
  \override Staff.MeasureGrouping.stencil = #triangle->tie-stencil
  \mus
}
  \layout {
\context {
  \Staff
  \consists "Measure_grouping_engraver"
}
  }
}

All the best,
  Harm

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


Re: changing symbols used by Measure_grouping_engraver

2018-08-03 Thread Torsten Hämmerle
Flaming Hakama by Elaine wrote
> In particular, how to change the symbol used to denote the dotted 8th
> value
> in compund time:
> instead of a triangle, how do I get a vertical bar (or slash)?

Hi Elaine,

The two options "triangle" and "bracket" are pretty much hardcoded.
But you can set the height (thus squeezing both forms into a vertical line
when you set height to 0) and thickness (to make this line as thick as you
like):

  \override Staff.MeasureGrouping.height = 0

That way, you'll get a vertical line (unfortunately the bracket will be
indistinguishable then from the triangle).

But you might define a custom stencil quite easily that sets the height to 0
if style is #'triangle and then calls the original print stencil.
In the following example, I've used the original snipped coding as a basis,
because in your example, there were no brackets at all.

%%%
\version "2.19.81"

#(define (custom-grouping-stencil grob)
   (let ((style (ly:grob-property grob 'style)))
 (if (eq? style 'triangle)
 (ly:grob-set-property! grob 'height 0))
 ly:measure-grouping::print))

\score {
  \new Voice \relative c'' {
\time 9/8
g8 g d d g g a( bes g) |
\set Timing.beatStructure = 2,2,2,3
g8 g d d g g a( bes g) |
\time 4,5 9/8
g8 g d d g g a( bes g) |
\time 5/8
a4. g4 |
  }
  \layout {
\context {
  \Staff
  \consists "Measure_grouping_engraver"
  \override MeasureGrouping.stencil = #custom-grouping-stencil
}
  }
}
%%%

 

HTH,
Torsten




--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

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