Re: Markup on clef possible

2019-02-12 Thread Pierre Perol-Schneider
Done!
(=> http://lsr.di.unimi.it/LSR/Item?id=1086)
Cheers,
Pierre

Le mar. 12 févr. 2019 à 00:18, Andrew Bernard  a
écrit :

> Hi Pierre,
>
> Marvellous. Works nicely in a quick try out. I'll put it to industrial use
> test it further.
>
> This is one of those functions that would be good as a snippet on LSR.
>
> Andrew
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Reusable simulateous notes?

2019-02-12 Thread Stig Brautaset
Hi!

I'm trying to transcribe the guitar parts of songs I like using
LilyPond. One thing I've found is that my score gets verbose quickly.
Here's a (minimal?) sample:

\version "2.19.80"
\new Staff {
  \clef "treble_8"
  4->
  
  \deadNote e,
  8->
  
}

My first attempt at making this a bit more readable, by assigning the
simultaneous note expression(?) a name, doesn't work as I expect.
Firstly using \accent (or ->) now becomes a syntax error, but more
importantly changing the duration of individual invocation doesn't work.
(It insert an _extra_ note of the new duration, it seems.)

\version "2.19.80"
e_five = 4
\new Staff {
  \clef "treble_8"
  \e_five
  \e_five
  \deadNote e,
  \e_five8
  \e_five
}

I also tried using \chordmode. Whil this allows me to use the (long
form) of \accent, and allows me to change chord duractions, I find it
less readable than my original attempt.

\version "2.19.80"
\new Staff {
  \clef "treble_8"
  \chordmode {
e,,4:5.8.12.15\accent
e,,:5.8.12.15
  }
  \deadNote e,
  \chordmode {
e,,8:5.8.12.15\accent
e,,:5.8.12.15
  }
}


Is there any way I can reduce the duplication of simultaneous notes and
make my scores a little bit more readable?

Regards,

Stig

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


Re: Reusable simulateous notes?

2019-02-12 Thread Jean Brefort
Hi,

You might use the q letter for repeated chords, such as:

\version "2.19.80"
 \new Staff {
   \clef "treble_8"
   4->
   q
   \deadNote e,
   q8->
   q
 }

Hope this helps,
Jean
 

Le mardi 12 février 2019 à 11:30 +, Stig Brautaset a écrit :
> Hi!
> 
> I'm trying to transcribe the guitar parts of songs I like using
> LilyPond. One thing I've found is that my score gets verbose quickly.
> Here's a (minimal?) sample:
> 
> \version "2.19.80"
> \new Staff {
>   \clef "treble_8"
>   4->
>   
>   \deadNote e,
>   8->
>   
> }
> 
> My first attempt at making this a bit more readable, by assigning the
> simultaneous note expression(?) a name, doesn't work as I expect.
> Firstly using \accent (or ->) now becomes a syntax error, but more
> importantly changing the duration of individual invocation doesn't
> work.
> (It insert an _extra_ note of the new duration, it seems.)
> 
> \version "2.19.80"
> e_five = 4
> \new Staff {
>   \clef "treble_8"
>   \e_five
>   \e_five
>   \deadNote e,
>   \e_five8
>   \e_five
> }
> 
> I also tried using \chordmode. Whil this allows me to use the (long
> form) of \accent, and allows me to change chord duractions, I find it
> less readable than my original attempt.
> 
> \version "2.19.80"
> \new Staff {
>   \clef "treble_8"
>   \chordmode {
> e,,4:5.8.12.15\accent
> e,,:5.8.12.15
>   }
>   \deadNote e,
>   \chordmode {
> e,,8:5.8.12.15\accent
> e,,:5.8.12.15
>   }
> }
> 
> 
> Is there any way I can reduce the duplication of simultaneous notes
> and
> make my scores a little bit more readable?
> 
> Regards,
> 
> Stig
> 
> ___
> 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


Re: Reusable simulateous notes?

2019-02-12 Thread Stig Brautaset
Hi Jean,

Jean Brefort  writes:
> You might use the q letter for repeated chords, such as:
> [...]
>4->
>q

Thank you! That certainly helps. 

Regards,

Stig

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


Re: Overrun of right margin

2019-02-12 Thread Trevor Bača
Hi Andrew, hi Aaron,

Yep (also for future archive searchers) I can confirm that the right margin
overrun results from the Lily default that glissando aren't breakable, as
Aaron identifies.

It should be enough to include just ...

   \override Score.Glissando.breakable = ##t

... to prevent this one particular instance of right margin overrun.

There are, of course, other conditions that can also cause right margin
overrun. Jean Bréfort pointed to barline-crossing durations earlier in this
thread, which can also cause right margin overrun. If you *want*
barline-crossing durations (complexism or music before 1600) then you need
to remove Lily's Forbid_line_break_engraver from every voice context in
which barline-crossing durations occur. Something like ...

\context {
\Voice
\remove Forbid_line_break_engraver
}

... does the trick for all voices in your score.

Andrew, if you're engraving a lot of complexist music, I suggest removing
the Forbid_line_break_engraver as a matter of course.


Trevor.

On Sat, Jan 19, 2019 at 7:13 PM Aaron Hill  wrote:

> On 2019-01-19 4:56 pm, Andrew Bernard wrote:
> > Problem solved after much deconstruction.
> >
> > I am setting a string quartet. In this section almost every note has a
> > glissando, and some become to small to see. So I set this:
> >
> > \override Glissando #'minimum-length = #5
> > \override Glissando #'springs-and-rods =
> > #ly:spanner::set-spacing-rods
> >
> > This works fine to give the minimum length of the glissandi. It turns
> > out
> > that this was forcing the score over the edge of the paper, not a
> > rhythmic
> > error. Adjusting that solves the problem. It's only when there are a
> > large
> > number of glissandi in the line that it occurs. I report this here in
> > case
> > it may help future archive searchers.
>
> This is probably because glissandi are unbreakable by default.  If you
> have one overlapping a bar line, then LilyPond cannot break there.
>
> Consider the following:
>
> 
> \version "2.19.82"
> {
>\override Glissando.minimum-length = #5
>\override Glissando.springs-and-rods = #ly:spanner::set-spacing-rods
>\override Glissando.breakable = ##t
>\repeat unfold 32 { f'8\glissando e''8\glissando } f'1
> }
> 
>
> If you omit setting 'breakable to true, you'll see the result extends
> all on one line.
>
> -- Aaron Hill
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>


-- 
Trevor Bača
www.trevorbaca.com
soundcloud.com/trevorbaca
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Use of \vspace and \hspace

2019-02-12 Thread Trevor Bača
Hi Andrew (and hi Valentin, nice to see you on the list again!),

I'm with you in the animating spirit of your observations about spacing
(especially horizontal spacing). Proportional spacing (which I helped
Han-Wen scope when he implemented it more than a decade ago) is very
powerful indeed. But I've engraved every single one of my scores (lots of
tuplets and rhythmic processes of all sorts going on, though I don't claim
a complexist mantle) in Lily for 13 years now, and reaching *full mastery*
of horizontal spacing in Lily still eludes me ... though I hasten to add
that my ability to control spacing of all types in Lily continues to
improve year over year, and the resulting layout of the scores continues to
improve quite significantly as a result. And I would never attempt what I
do now in my own music in other engraving package.

Sometime soon I'd like to find the time to summarize some of what I've
learned about Lily's spacing (and also what still eludes me, which is
rather a bit), but it's a daunting task. In the meantime I want to point to
a bug that I've needed to report to the -bug list for sometime now (will
open formally on -bug soon) and which might help explain some of what
you've experienced with spacing sections:

While I can't vouch for the complete set of behaviors that you get when you
use \newSpacingSection, using the command *does largely seem to work* for
me as a way of laying out rhythmically complex music. The basic idea (which
I'm sure you know, and have probably tried in your engraving of complexist
scores) is: call \newSpacingSection at the beginning of a bar (otherwise
Lily will ignore the command); and at that same moment, reset
propotionalNotationDuration to best match the contents (rhythmic density,
primarily) of the measure at hand. It was a years-long evolution getting
there, but I now do this *to every measure* in all my scores, and it seems
to be the best first-order strategy for optimizing spacing. (Why
"first-order"? Because there are still always a million-and-one second- and
third-order steps involving turning off the horizontal widths of items,
which is pretty much exactly what you were pointing to earlier in this
thread.)

The outstanding bug, though, is this: Lily systematically overstretches the
horizontal width of system-final measures that carry a \newSpacingSection
at their start! The factor of over-stretching (by eye-balling) is very
close to 35/24. Meaning that the last measure of any system that you
spacing-control in the way I've described here (with \newSpacingSection and
proportionalNotationDuration) will be almost exactly 35/24 *longer* than
what you've specified. It's a truly unique behavior (bug) in Lily; nothing
else in the system seems to work quite this way.

The workaround is, of course, that scale your proportionalNotationDuration
by the reciprocal of the overstretching, ie, 24/35.

Later on a much fuller discussion (and *documentation*) of the entire
collection of spacing concerns would be truly useful. Hope this small
breadcrumb might be useful for you in the nearterm.

Trevor.




On Sun, Jan 20, 2019 at 7:32 AM Andrew Bernard 
wrote:

> Hi Valentin,
>
> I was led to muse just today that almost all the recent questions on
> lilypond are about spacing and tweaking positions of some sort or other.
> [Well, I suppose you could argie that engraving is only about spacing
> objects and nothing else anyway!] With no disrespect to any documentation
> developers, this does seem to be a major stumbling block for people,
> including me, and I am using lilypond professionally for years. I recently
> referred in a post to the Missing Manual for Lilypond. This topic would be
> a good choice for the main contents of such a doc. I'd volunteer to write
> but but although an experienced user, I just lack something fundamental
> understanding lilypond internals that leaves me permanently flummoxed. For
> example, when to use extra-spacing-width, which always eludes me until I
> post to the list.
>
> Horizontal spacing perpetually bugs me. I need to do very strict
> proportional spacing to set New Complexity School scores for the composer I
> engrave for, and it never works satisfactorily, and seems hit and miss at
> the best of times. Lilypond does a beautiful job of heuristically laying
> things out but when you want to constrain it, for example, to make bars
> exactly 3cm wide, it just does not respond. I'd like to see a really good
> explanation of that topic, and spacing sections, which have _never_ been
> able to get to work.I use the latest dev. versions at all times. Currently
> I am hitting issues where the notes at the end of lines smash up too hard
> against the barline, and understanding why that is so is beyond me, let
> alone how you work out how to address this.
>
> Just my A$0.02 worth.
>
> Andrew
>
>
>
>
> On Sun, 20 Jan 2019 at 22:11, Valentin Villenave 
> wrote:
>
>> On 1/20/19, Aaron Hill  wrote:
>> > \markup may additionally be used for lyrics, 

Re: Clef moves notes why??

2019-02-12 Thread Trevor Bača
Hi,

I like to use an extra-offset clef *with false X-extent* to move clefs into
whitespace in my cutaway scores. This pair of overrides ...

\once \override Staff.Clef.X-extent = ##f
\once \override Staff.Clef.extra-offset = #'(-2.8 . 0)

... seems to do the trick.

The example from the top of the thread then rewrites this way:

%%% BEGIN %%%

\version "2.19.82"
<<
\new Staff {
\repeat unfold 100 { c'4 }
}
\new Staff {
\repeat unfold 20 { g'2 }
g'1
\stopStaff
s1*4
\startStaff
\once \override Staff.Clef.X-extent = ##f
\once \override Staff.Clef.extra-offset = #'(-2.8 . 0)
\clef treble
\repeat unfold 20 { e'2 }
}
>>

%%% END %%%

[image: left-offset-clef.png]


Usage notes:

1. As always, there's the question of Grob.X-extent = ##f versus
Grob.X-extent = #'(0 . 0). I've never been able to understand,
systematically, when to use one and when to use the other. Sometimes the
overrides are interchangeable. But in this case the overrides differ
importantly: make sure to use Staff.Clef.X-extent = ##f (as shown). If you
use Staff.Clef.X-extent = #'(0 . 0) then Lily will mysteriously draw a
little extra fringe of stafflines into the white cutaway part of your score.

2. The magic value of -2.8 in the extra-offset is eyeballed; tweak manually
to control the whitespace between the clef and following barline. Change
the number when using a C of F clef.


Trevor.


On Thu, Jan 24, 2019 at 5:08 PM Karlin High  wrote:

> On 1/24/2019 4:06 PM, Reggie wrote:
> > Need to? But what If I wish to have the clef on the right side of the
> > barline but have the notes on the other staff be lined up as if I DID put
> > clef to the left of the barline? Say I want, is this possible?
>
> The question isn't whether this is possible. LilyPond is flexible enough
> that it can be used as a graphical drawing app. Kieren MacMillan and
> Pierre Perol-Schneider have posted examples last month.
>
> Rather, the question is: How much effort is it worth expending to get
> the effect you want? So far there have been LilyPond experts who are
> willing to help, like Valentin Villenave just now. But their capacity
> for doing this is not unlimited.
> --
> Karlin High
> Missouri, USA
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>


-- 
Trevor Bača
www.trevorbaca.com
soundcloud.com/trevorbaca
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: aligning variables with upbeats

2019-02-12 Thread Pedro Pessoa
Hello John,
I took this task as a way of learning a bit more about moments and durations
(and also, I wanted to achieve this a while ago). It is certainly not a very
robust or elegant solution, but seems to work for this particular case.

%% \makeRestOfLenght \mus "rest/skip" upbeat %%

\version "2.19.82"
partA = { c'2 b | R1*3 }
partB = { \partial 4 g4 | \bar "||"  c'1 }

#(define (make-dynamic-rest len event)
   "The rest/skip body."
   (make-music
event ; To choose if it is gonna be Skip or Rest
'duration
; intlog transforms the rational values used in Moments (the
denominator) into log values used in Durations.
; 1 (whole)->0
; 2 (half)->1
; 4 (quarter)->2 ... etc
(ly:make-duration (ly:intlog2 len

#(define (makeRestofLog num den opts)
   "Logging function"
   (display (format "~%>> \\makeRestOfLenght:~%~A ~As of value ~A will be
created:~%" num opts den)))

makeRestOfLenght=
#(define-scheme-function (mus opts upbeat)(ly:music? string? ly:music?)
   "Creates a series of rests/skips of the same length as the given music
minus an upbeat value. Opts are 'rest', 'skip'. Anything else calls 'rest'."
   (let* ((musLen (ly:music-length mus));
   (upBeatLen (ly:music-length upbeat))
   (musMinusUp (ly:moment-sub musLen upBeatLen))
   (den (ly:moment-main-denominator musMinusUp))
   (num (ly:moment-main-numerator musMinusUp))
   (event (cond
   ((string>= opts "skip")
'SkipEvent)
   ((string>= opts "rest")
'RestEvent)
   (else 
(set! opts "rest")
'RestEvent)
   ))
   (rests '()))
 (makeRestofLog num den opts) ; Didatic logging.

 ; Iterate over the number of rest needed (given by the numerator).
 ; The value of the rest is given by the denominator.
 (let loop ((i 0))
   (if (< i num)
   (begin
(set! rests (append rests (list (make-dynamic-rest den event
(loop (+ i 1)
 (newline)
 (make-music 
  'SequentialMusic
  'elements
  rests)
 ))

\score {
  \new Staff <<
\new Voice \partA
\new Voice {
  % \makeRestOfLenght \partA "rest" 4 % To visualize rests.
  \makeRestOfLenght \partA "skip" 4
  \partB
}
  >>
}





--
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: Text spanner shorten-pair

2019-02-12 Thread Trevor Bača
On Fri, Jan 25, 2019 at 11:38 AM Carl Sorensen  wrote:

>
>
>
>
> *From: *Andrew Bernard 
> *Date: *Friday, January 25, 2019 at 6:21 AM
> *To: *lilypond-user Mailinglist 
> *Subject: *Re: Text spanner shorten-pair
>
>
>
> Hi Aaron,
>
>
>
> I know. This then implies the NR is in error. Do we report a bug? [For the
> reason that being thrown off the scent I spent hours looking all in the
> interfaces to no avail.]
>
>
>
> I think this is absolutely a bug.  It should not say shorten-pair applies
> to TextSpanners when it does not.
>
>
>
> There are three possible solutions I can see:
>
>
>
>1. Fix the description of shorten-pair to indicate which spanners it
>applies to
>2. Create a new interface e.g. shortenable-spanner-interface that
>contains shorten-pair, and then give that interface to all the grobs that
>accept shorten-pair (see dynamic-line-spanner-interface for a similar
>single-property interface).
>
>
>
> The padding works. Seems inconsistent to me. Why do we leave TextSpanners
> out of the group?
>
>1. Add the shorten-pair property to the spanner-interface (or maybe
>the text-spanner interface) and make sure it works with all of the objects
>having that interface.
>
>
>
> My preference right now would probably be #2.
>
>
>
> I have not made an exhaustive study of this, but my initial thought is
> that there are two kinds of spanners.
>
>
>
> Spanner type A goes from one grob to another (e.g. TextSpanner,
> glissando).  These spanners can be shortened by adding padding, because
> they will need to move away from the grobs that they connect when the
> padding is increased.
>
>
>
> Spanner type B goes from one column to another (e.g. hairpin, pedal
> bracket).  These spanners don’t have grobs at their ends, so padding will
> not be effective at shortening them.  Hence the need for another method, as
> met by the shorten-pair property.
>
>
>
> One could add the shorten-pair property to the type A spanners, but it’s
> not necessary to do so to shorten them.
>
>
>
> I don’t know what I prefer for the long-term solution.  It would take more
> study and consideration of the pros and cons of each method.
>

Hi Carl, hi Andrew,

Also agreed that this is very much a bug; I've watched beginners get hit by
it many times.

Question: why are there two ways to move around the ends of spanners
(padding vs. shortening)? I can't think of a reason that's motivated by
music notation. Which maybe implies that there's a fourth solution:

4. Collapse shorten-pair into padding (or vice versa), and preserve one
(and only one) such property for *ALL* spanners.


Trevor.


-- 
Trevor Bača
www.trevorbaca.com
soundcloud.com/trevorbaca
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Can alternateTextSpannerEngraver now completely replace Text_spanner_engraver in a public release?

2019-02-12 Thread Trevor Bača
Hi,

For many years, one of the clearest functional gaps in LilyPond was the
limitation that voices allow only a single text spanner at a time. Very
many scores of recent decades notate two musical parameters changing at the
same time: a passage of string music moving ponticello -> tasto while at
the same time decreasing from vibrato molto -> non vibrato, for example.
Arrowed lines are the nearly universal way of notating such things,
available in LilyPond as text spanners; but to allow for what now counts as
newly emerged common practice, an arbitrary number of text spanners need to
be allowed per voice.

Lily users have asked for the feature for a long time. Here's an example
from 2009:

http://lists.gnu.org/archive/html/lilypond-user/2009-11/msg00031.html

By 2015, the idea of spanner-id had been added to LilyPond to allow for
this type of functionality. But despite the name of the property ("will
spanner-id allow for ALL types of spanner to overlap?"), integration first
centered on slurs and phrasing slurs. Here's a thread from 2015 with David
K. working to allow an input syntax for those first two types of spanner:

http://lists.gnu.org/archive/html/lilypond-user/2015-10/msg00157.html

At that same time in 2015, however, David N. had in fact rewritten Lily's
Text_spanner_engraver to integrate spanner-id, and hence supply the missing
functionality. David N.'s attachment (given later in the same thread listed
above) gives the necessary code:

http://lists.gnu.org/archive/html/lilypond-user/2015-10/msg00545.html

Last year, in May 2018, I finally integrated David N.'s
alternateTextSpannerEngraver into my own work, using it to replace Lily's
default Text_spanner_engraver completely. The results have been extremely
good: *David N.'s alternateTextSpannerEngraver performs exactly the same as
the current Text_spanner_engraver but with the additional flexibility of
being able to define (and use) arbitrarily many types of text spanner in a
single voice.*

So, it looks like David N.'s alternateTextSpannerEngraver supplies a piece
of functionality that's been missing in LilyPond since inception, which is
fantastic.

Question: is it now possible to replace Text_spanner_engraver with David
N.'s extended implementation, in a coming public release of LilyPond?


Trevor.

-- 
Trevor Bača
www.trevorbaca.com
soundcloud.com/trevorbaca
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Text Spanner ID Layer Spans

2019-02-12 Thread Reggie
Using a David's function to allow layering spanners, could you please tell me
how to acheive the spanners over one another and not overlap? I know the
colors example tweak command but using real words and spanner I cannot
figure out how to make them on top of each other. Begin at the same time.
Thank you for the help.
lay.png   
\version "2.19.82"
\include "text-spanner-id.ly"
{
  \override TextSpanner.bound-details.left.text =
  \markup { \upright "rit." }
  b1\startTextSpanOne
  \override TextSpanner.bound-details.left.text =
  \markup { \upright "other span" }
  c\startTextSpanTwo
  e,\stopTextSpanOne
  c\stopTextSpanTwo
}








--
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: Text Spanner ID Layer Spans

2019-02-12 Thread David Kastrup
Reggie  writes:

> Using a David's function to allow layering spanners,

I like "a David's function".  It's like describing a caste of priests.

-- 
David Kastrup

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


Re: Text Spanner ID Layer Spans

2019-02-12 Thread Reggie
David Kastrup wrote
> Reggie <

> reegistoop@

> > writes:
> 
>> Using a David's function to allow layering spanners,
> 
> I like "a David's function".  It's like describing a caste of priests.
> 
> -- 
> David Kastrup
> 
> ___
> lilypond-user mailing list

> lilypond-user@

> https://lists.gnu.org/mailman/listinfo/lilypond-user

Sorry David :))
Do you know the solution to my question?



--
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: Text Spanner ID Layer Spans

2019-02-12 Thread Trevor Bača
On Tue, Feb 12, 2019 at 5:47 PM Reggie  wrote:

> David Kastrup wrote
> > Reggie <
>
> > reegistoop@
>
> > > writes:
> >
> >> Using a David's function to allow layering spanners,
> >
> > I like "a David's function".  It's like describing a caste of priests.
> >
> > --
> > David Kastrup
> >
> > ___
> > lilypond-user mailing list
>
> > lilypond-user@
>
> > https://lists.gnu.org/mailman/listinfo/lilypond-user
>
> Sorry David :))
> Do you know the solution to my question?
>

Hi Reggie,

To layer text spanners with David N.'s new functionality, you must \tweak
spanner properties rather than overriding them.

%%% BEGIN %%%

\version "2.19.82"
\include "text-spanner-id.ly"
{
b1
- \tweak bound-details.left.text \markup { \upright "rit." }
\startTextSpanOne
- \tweak bound-details.left.text \markup { \upright "other span" }
\startTextSpanTwo
c
e,
\stopTextSpanOne
c
\stopTextSpanTwo
}

%%% END %%%


[image: layered-start-stop.png]


Trevor.

-- 
Trevor Bača
www.trevorbaca.com
soundcloud.com/trevorbaca
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Text Spanner ID Layer Spans

2019-02-12 Thread David Kastrup
Reggie  writes:

> David Kastrup wrote
>> Reggie <
>
>> reegistoop@
>
>> > writes:
>> 
>>> Using a David's function to allow layering spanners,
>> 
>> I like "a David's function".  It's like describing a caste of priests.
>
> Sorry David :))
> Do you know the solution to my question?

It turns out that the Davids are not entirely interchangeable so let's
see whether another David has a good idea about his code.

-- 
David Kastrup

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


Re: Text spanner shorten-pair

2019-02-12 Thread Carl Sorensen


From: Trevor Bača 
Date: Tuesday, February 12, 2019 at 3:09 PM
To: Carl Sorensen 
Cc: Andrew Bernard , lilypond-user Mailinglist 

Subject: Re: Text spanner shorten-pair

On Fri, Jan 25, 2019 at 11:38 AM Carl Sorensen 
mailto:c_soren...@byu.edu>> wrote:

Question: why are there two ways to move around the ends of spanners (padding 
vs. shortening)? I can't think of a reason that's motivated by music notation.

Padding is a minimum amount of blank space between two pieces of ink on the 
page.  When a pedal bracket is running into empty space, it doesn’t matter what 
the padding setting is, because there is no ink for it to move away from.  
Padding says “don’t just avoid collisions; leave a minimum amount of empty 
space in addition to avoiding collisions”.  There’s no collision to avoid 
between a pedal bracket and its associated note column.

Which maybe implies that there's a fourth solution:

4. Collapse shorten-pair into padding (or vice versa), and preserve one (and 
only one) such property for *ALL* spanners.

It seems to me that if you are to collapse into a single property, it would 
need to be shorten-pair, because we already have padding and it doesn’t do what 
you want if there’s no ink to avoid.   But I haven’t looked at all into how the 
code would need to change with the spanners that don’t currently have 
shorten-pair.

Thanks,

Carl

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


Re: Text Spanner ID Layer Spans

2019-02-12 Thread Reggie
Trevor Bača-2 wrote
> Hi Reggie,
> 
> To layer text spanners with David N.'s new functionality, you must \tweak
> spanner properties rather than overriding them.
> 
> %%% BEGIN %%%
> 
> \version "2.19.82"
> \include "text-spanner-id.ly"
> {
> b1
> - \tweak bound-details.left.text \markup { \upright "rit." }
> \startTextSpanOne
> - \tweak bound-details.left.text \markup { \upright "other span" }
> \startTextSpanTwo
> c
> e,
> \stopTextSpanOne
> c
> \stopTextSpanTwo
> }
> 
> %%% END %%%
> 
> 
> [image: layered-start-stop.png]
> 
> 
> Trevor.
> 
> -- 
> Trevor Bača
> www.trevorbaca.com
> soundcloud.com/trevorbaca

Much thanks Trevor!!



--
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: aligning variables with upbeats

2019-02-12 Thread 智樂喬
Thanks, Pedro, this is some interesting code! There's definitely something
for me to learn here.

On Wed, Feb 13, 2019 at 4:13 AM Pedro Pessoa  wrote:

> Hello John,
> I took this task as a way of learning a bit more about moments and
> durations
> (and also, I wanted to achieve this a while ago). It is certainly not a
> very
> robust or elegant solution, but seems to work for this particular case.
>
> %% \makeRestOfLenght \mus "rest/skip" upbeat %%
>
> \version "2.19.82"
> partA = { c'2 b | R1*3 }
> partB = { \partial 4 g4 | \bar "||"  c'1 }
>
> #(define (make-dynamic-rest len event)
>"The rest/skip body."
>(make-music
> event ; To choose if it is gonna be Skip or Rest
> 'duration
> ; intlog transforms the rational values used in Moments (the
> denominator) into log values used in Durations.
> ; 1 (whole)->0
> ; 2 (half)->1
> ; 4 (quarter)->2 ... etc
> (ly:make-duration (ly:intlog2 len
>
> #(define (makeRestofLog num den opts)
>"Logging function"
>(display (format "~%>> \\makeRestOfLenght:~%~A ~As of value ~A will be
> created:~%" num opts den)))
>
> makeRestOfLenght=
> #(define-scheme-function (mus opts upbeat)(ly:music? string? ly:music?)
>"Creates a series of rests/skips of the same length as the given music
> minus an upbeat value. Opts are 'rest', 'skip'. Anything else calls
> 'rest'."
>(let* ((musLen (ly:music-length mus));
>(upBeatLen (ly:music-length upbeat))
>(musMinusUp (ly:moment-sub musLen upBeatLen))
>(den (ly:moment-main-denominator musMinusUp))
>(num (ly:moment-main-numerator musMinusUp))
>(event (cond
>((string>= opts "skip")
> 'SkipEvent)
>((string>= opts "rest")
> 'RestEvent)
>(else
> (set! opts "rest")
> 'RestEvent)
>))
>(rests '()))
>  (makeRestofLog num den opts) ; Didatic logging.
>
>  ; Iterate over the number of rest needed (given by the numerator).
>  ; The value of the rest is given by the denominator.
>  (let loop ((i 0))
>(if (< i num)
>(begin
> (set! rests (append rests (list (make-dynamic-rest den
> event
> (loop (+ i 1)
>  (newline)
>  (make-music
>   'SequentialMusic
>   'elements
>   rests)
>  ))
>
> \score {
>   \new Staff <<
> \new Voice \partA
> \new Voice {
>   % \makeRestOfLenght \partA "rest" 4 % To visualize rests.
>   \makeRestOfLenght \partA "skip" 4
>   \partB
> }
>   >>
> }
>
>
>
>
>
> --
> 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
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


percent repeats (bug?)

2019-02-12 Thread 智樂喬
\repeat percent is not as "smart" as I was hoping it would be. When dealing
with repeats longer than two bars, there are two issues:

   1. The percent symbol is not centered, but placed in the left-most
   measure; and
   2. The slashes of the percent symbol do not reflect the number of
   measures being repeated.

I grepped through /usr/share/lilypond looking for beat-slash, which from
the internals reference seemed a promising place to look. There are two
grobs defined in define-grobs.scm, one for RepeatSlash and one for
DoubleRepeatSlash. Unfortunately I can't see how I might be able to add
TripleRepeatSlash and QuadrupleRepeatSlash. Otherwise, I might just write
them myself and manually add them to my score, but that's still far from
preferable, of course.

Preferably, \repeat would simply take the length of the music into
consideration and adjust placement and the number of slashes accordingly.

Is there a way that these two issues can be resolved? (Also, can this be
considered a bug?)

Here's a minimal example (with attached png) that demonstrates the issue:

\version "2.19.82"
\repeat percent 4 { \mark "perfect" c'2 d' | c'1 | }
\repeat percent 4 { \mark "3-bar" c'2 d' | c' e' | g'1 | }
\repeat percent 4 { \mark "4-bar" c'2 d' | c'1 | c' | c' | }


Thanks,

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