Re: Analysis brackets with text [was: how to get notes without tails?]

2015-09-01 Thread David Nalesnik
On Tue, Sep 1, 2015 at 4:01 PM, Paul Morris  wrote:

> Hi David,
>
> On Aug 31, 2015, at 8:20 AM, David Nalesnik 
> wrote:
>
> Which of course makes them unsuitable for showing phrase elision.
>
> Or longer overlaps:



 \relative c'' {
  c\startGroup d c\startGroup d\stopGroup c d\stopGroup
}

\layout {
  \context {
\Voice
\override HorizontalBracket.direction = #UP
\consists Horizontal_bracket_engraver
  }
}



The first \stopGroup closes the smaller grouping, because the system is
designed so that brackets nest cleanly.

Interestingly, this overlap is possible with slurs:

%

\version "2.19.25"

secondSlur = #(make-music 'SlurEvent 'span-direction START 'spanner-id "2")
secondEnd = #(make-music 'SlurEvent 'span-direction STOP 'spanner-id "2")

\relative c'' {
  c( d c\secondSlur d) c d\secondEnd
}

%%

This, too:



thirdSlur = #(make-music 'SlurEvent 'span-direction START 'spanner-id "3")
thirdEnd = #(make-music 'SlurEvent 'span-direction STOP 'spanner-id "3")

\relative c'' {
  c-\tweak Slur.positions #'(4 . 4) ( \secondSlur
  c\secondEnd\secondSlur -\tweak Slur.positions #'(3 . 3)\thirdSlur
  c\secondEnd\secondSlur
  c)\secondEnd\thirdEnd
  c( d c\secondSlur d) c d\secondEnd
}

%%%

Maybe a system could be devised where brackets nest by default, but a
spanner-id property can be used to create more sophisticated structures?

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


Re: Analysis brackets with text [was: how to get notes without tails?]

2015-09-01 Thread Paul Morris
Hi David,

> On Aug 31, 2015, at 8:20 AM, David Nalesnik  wrote:
> 
> Which of course makes them unsuitable for showing phrase elision.
> 
> Getting a TextSpanner to begin on a note and another to start on the same 
> note requires some sleight-of-hand (you can see this in Scheme in the 
> regression test scheme-text-spanner.ly ).  I 
> wonder if the to accommodate nested brackets ruled "conflicting note group 
> events" out?

Good point.  I imagine you’re right.  

-Paul

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


Re: Analysis brackets with text [was: how to get notes without tails?]

2015-08-31 Thread David Nalesnik
Hi Paul.

On Sun, Aug 30, 2015 at 10:10 PM, Paul Morris  wrote:

> Oh, one other thing I noticed.  There seems to be no way to have one
> bracket end at a note and another bracket start at that same note.
> ("warning: conflicting note group events”)  I tried spacer rests, but no
> luck.  It seems the start or end of a group cannot be a spacer rest.
> Anyway, I thought I'd mention this, FWIW.
>

Which of course makes them unsuitable for showing phrase elision.

Getting a TextSpanner to begin on a note and another to start on the same
note requires some sleight-of-hand (you can see this in Scheme in the
regression test scheme-text-spanner.ly).  I wonder if the to accommodate
nested brackets ruled "conflicting note group events" out?

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


Re: Analysis brackets with text [was: how to get notes without tails?]

2015-08-30 Thread David Nalesnik
Hi Paul,

On Sun, Aug 30, 2015 at 4:51 PM, Paul Morris p...@paulwmorris.com wrote:

 Hi David,

 On Aug 30, 2015, at 3:16 PM, David Nalesnik david.nales...@gmail.com
 wrote:


 LilyPond already has the ability to make analysis brackets, which are
 attached to note columns and can nest as in the link (HorizontalBracket).
 I have an old patch for adding text to these that I will finish up and
 post.  (I have code for doing this in Scheme, but my approach now is an
 enhancement of the C++ engraver.)


 The attached file is what I used to use when making form handouts.


 This is great!  – both the analysis brackets (which I didn’t know about
 before) and your code for text labels for them.  I’ve often resorted to
 using Inkscape to add this kind of thing to LilyPond SVGs.

 In trying out your code I noticed that it didn’t really work when the text
 was wider than the bracket (the bracket was pushed over out of place).  So
 I came up with a revision that handles this, using the
 “center-stencil-on-stencil” function I recently contributed to the LSR.
 See attached.


Good catch.  Thanks!



 Would be nice to have this in the LSR, at least.  It also might be nice if
 it could accept a markup instead of a string, so you could change the
 appearance of the text (size, color, style, etc.).


Actually, you can.  The syntax is just a little awkward, though:

 gluck = \relative c'' {
  \time 3/4
  \key f \major
  \override HorizontalBracket.direction = #UP
  c4-\tweak stencil #(label #{ \markup \italic \center-column {
contrasting period } #}
   #{ \markup \italic \center-column { period
(cont.) } #})
  \startGroup
  -\tweak stencil #(label a a )\startGroup
  a8( bes c f)
  f4( e d)
  c d8( c bes c)
  \appoggiatura bes4 a2 g4 \stopGroup
  %\break
  f'8-\tweak stencil #(label b b)\startGroup r a, r d r
  c4( e, f)
  g8( bes) a4 g8( f)
  f2 \stopGroup \stopGroup r4
}

%%%

The plan at the moment is to create a grob HorizontalBracketText.  That
will allow easy use of markups through overrides of a 'text property:

\override HorizontalBracketText.text = \markup ...

and tweakability.

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


Re: Analysis brackets with text [was: how to get notes without tails?]

2015-08-30 Thread Paul Morris
Oh, one other thing I noticed.  There seems to be no way to have one bracket 
end at a note and another bracket start at that same note. (warning: 
conflicting note group events”)  I tried spacer rests, but no luck.  It seems 
the start or end of a group cannot be a spacer rest.  Anyway, I thought I'd 
mention this, FWIW.

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


Re: Analysis brackets with text [was: how to get notes without tails?]

2015-08-30 Thread Paul Morris
Hi David,

That’s great that markups already work (I should have tried it before assuming 
they didn’t).  The plan for HorizontalBracketText sounds even better.  

Thanks again,
-Paul


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


Re: Analysis brackets with text [was: how to get notes without tails?]

2015-08-30 Thread Mike Solomon


My go-to solution (which is hackish) has been to create a tuplet over spacer 
rests and change the tuplet number text. 
Cheers,MS


Sent from my Samsung device

 Original message 
From: Paul Morris p...@paulwmorris.com 
Date: 31/08/2015  05:32  (GMT+02:00) 
To: David Nalesnik david.nales...@gmail.com 
Cc: lilypond-user Mailinglist lilypond-user@gnu.org 
Subject: Re: Analysis brackets with text [was: how to get notes without tails?] 

Hi David,

That’s great that markups already work (I should have tried it before assuming 
they didn’t).  The plan for HorizontalBracketText sounds even better.  

Thanks again,
-Paul


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