Re: Fwd: purple highlight in Frescobaldi

2018-10-26 Thread Ben

On 10/26/2018 7:10 PM, Joseph Austin wrote:




Begin forwarded message:

*From: *Joseph Austin >

*Subject: **purple highlight in Frescobaldi*
*Date: *October 26, 2018 at 5:56:16 PM EDT
*To: *ilypond-u...@gnu.org 

A line of music entered in Frescobaldi was highlighted in purple:
what does this signify?
There was no error message in the log,
and the rendering appears to be as intended.

\language "english"
...
previous line:
 r4 d ef d | d2 g, | r4 c d c | c2 f, | \break

Highlighted line:
r4 f g bf | ef ef2 d4 | \noBreak ef8 d ef d ef4 d | \noBreak 1~ 
| < bf f> |


Frescobaldi 2.20.0
Lilypond 2.19.80
Mac OS 10.13.4

Joe Austin




Hello,

I copied that code into Frescobaldi and see no highlighting. Are you 
sure the line itself is not just the currently selected line?



\language "english"

{
     r4 d ef d | d2 g, | r4 c d c | c2 f, | \break

r4 f g bf | ef ef2 d4 | \noBreak ef8 d ef d ef4 d | \noBreak 1~ | 
< bf f> |

}

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


Re:Complex --evaluate command line option

2018-10-26 Thread Flaming Hakama by Elaine
> -- Forwarded message --
> From: Peter Anglea 
> To: lilypond-user@gnu.org
> Date: Fri, 26 Oct 2018 10:12:17 -0400
> Subject: Complex --evaluate command line option
> I’m trying to use the -e (--evaluate) option to define a hash, not just a
> single variable. For instance
>
> lilypond -e ‘((define myhash (make-hash-table))(hashq-set! myhash
> ‘foo “bar”))’ file.ly
>
> The above doesn’t work. I think, obviously, it’s breaking at the single
> quote – ‘foo.
>
> I’ve tried escaping it with a backslash (\’foo) and a couple other things,
> but nothing seems to work.
>
> Is it possible to run complex Scheme code in the command line option,
> and/or am I just not escaping special characters the right way?
>

I'm just going to comment on bash shell syntax, since I'm not quite sure
what to expect the scheme code to do in lilypond, or if there are any
prerequisites of file.ly for this command to work.


In any case, for bash shell syntax:
Within single quotes, there is no evaluation, no escaping, and
everything is taken as-is.
Within double quotes, things are evaluated, and the backslash character
is used to escape (to prevent evaluation, as well as to include double
quotes within the string).
Outside of quotes, things are evaluated and the backslash character is
used to escape.

The only difference in this regard between double quotes and no quotes is
that everything within double quotes is taken as a "word", and outside of
quotes, whitespace delineates "words".  (Outside quotes, you can escape
spaces to prevent splitting of words on whitespace).


Your above line would parse into these "words"

lilypond
-e
'((define myhash (make-hash-table))(hasq-set! myhash'
foo
"bar"
))
   'file.ly

with the last expression having unmatched single quote, so it is not a
complete expression


Since your scheme expression has both single and double quotes, you would
need to put the entire scheme expression in double quotes, then escape the
double quotes around "bar":

lilypond -e "((define myhash (make-hash-table))(hashq-set! myhash 'foo
\"bar\"))" file.ly


Unfortunately, I'm not too familiar with what this should do, or if it
should work with any file.ly.
When I tried it against a random .ly file, I got:

lilypond -e "((define myhash (make-hash-table))(hashq-set! myhash 'foo
\"bar\"))" voices.ly
GNU LilyPond 2.19.80
:1:8: In expression ((begin #) (hashq-set!
myhash # ...)):
:1:8: Wrong type to apply: #



HTH,

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


Fwd: purple highlight in Frescobaldi

2018-10-26 Thread Joseph Austin


> Begin forwarded message:
> 
> From: Joseph Austin 
> Subject: purple highlight in Frescobaldi
> Date: October 26, 2018 at 5:56:16 PM EDT
> To: ilypond-u...@gnu.org
> 
> A line of music entered in Frescobaldi was highlighted in purple:
> what does this signify?
> There was no error message in the log,
> and the rendering appears to be as intended.
> 
> \language "english"
> ...
> previous line:
>  r4 d ef d | d2 g, | r4 c d c | c2 f, | \break
> 
> Highlighted line:
> r4 f g bf | ef ef2 d4 | \noBreak ef8 d ef d ef4 d | \noBreak 1~ | < bf 
> f> |
> 
> Frescobaldi 2.20.0
> Lilypond 2.19.80
> Mac OS 10.13.4
> 
> Joe Austin

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


Re: Line-breaking with non-aligned barlines

2018-10-26 Thread David Sumbler


-Original Message-
From: Thomas Morley 
To: David Sumbler 
CC: lilypond-user 
Subject: Re: Line-breaking with non-aligned barlines
Date: Fri, 26 Oct 2018 18:56:15 +0200

> Hi,
> 
> you likely know lily breaks only at matching BarLines.
> So you have to insert a \bar "" at appropriate place. Which is tricky
> here, because there is _no_ appropriate place.
> 
> Well, then create one, i.e.
> instead of the original event, insert same simultaneous music like
> << e { s \bar "" s } >>
> and then figure out which duration the first skip must have.
> 
> Which is tricky as well. For that purpose I use:
> ctxMom =
>   \applyContext
>   #(lambda (ctx)
> (format #t "\nin context~a: ~a" ctx (ly:context-current-moment
> ctx)))
> 
> and insert \ctxMom where I wrote \break (below I've did it in
> FifteenHarpsUpper) and before the second skip of the inserted
> simultaneous music in FifteenFlute.
> Now I can scale the duration of the first skip until both values of
> \ctxMom match.
> 
> 
> \version "2.19.81"
> 
> ctxMom =
>   \applyContext
>   #(lambda (ctx)
> (format #t "\nin context~a: ~a" ctx (ly:context-current-moment
> ctx)))
> 
> 
> \language "english"
> 
> #(set-global-staff-size 16)
> 
> gliss = \markup { \larger \italic "gliss." }
> 
> FifteenFlute = {
>   <<
> { \relative {
>   R1 | R1\fermataMarkup |
> \override Staff.TimeSignature.stencil = ##f
> \time 25/16
> \scaleDurations 8/4 { bf''8[(\mf a16]) r }
> \scaleDurations 7/4 { bf8[( a16]) r }
> \scaleDurations 6/4 { bf8[( a16]) r }
> bf8[( a16]) r
> \time 4/4
> \tuplet 5/4 {
>   bf8( c df ef
>   << e { s1*15/320 \bar "" \ctxMom s } >>
> }
> fs2
> \time 7/8
> \scaleDurations 7/8 { e4 ds cs bs) }
> \time 9/16
> R1*9/16\fermataMarkup
> \time 4/4
> } }
>   >>
> }
> 
> ScoreFifteenFirstViolinA = {
>   <<
> { \relative {
>   d'8(\p\>\glissando^\gliss g)\! r4
>   \override DynamicText.X-offset = #-2
>   g8(\mp\>\glissando^\gliss b)\! r4 |
>   b8(\mf\>\glissando^\gliss d)\! r4
>   \revert DynamicText.X-offset
>   d8(\f\>\glissando^\gliss e)\! r4\fermata |
>   R1*3 | R1\fermataMarkup |
> } }
>   >>
> }
> 
> FifteenHarpsUpper = {
>   <<
> { \relative {
>   R1 |
>   R1\fermataMarkup |
>   \key a \major
>   a''16\mf \repeat unfold 9 { gs a } b bs cs d ds e cs a e cs e
> gs
> a |
>   \break
>   \ctxMom
>   \repeat unfold 9 { b as } b cs ds e b gs e8 r \acciaccatura ds'
> e r\fermata |
> } }
>   >>
> }
> 
> FifteenHarpsLower = {
>   <<
> \clef bass
> { \relative {
>R1 | R1\fermataMarkup |
>   \key a \major
>   \clef treble
>   \repeat unfold 4 { a16 e' cs e a e cs e } | \repeat unfold 2 {
> a, fs' d fs a fs d fs } |
>   gs, e' d e gs e d e gs,8 r \clef bass \acciaccatura ds e
> r\fermata |
>  } }
>   >>
> }
> 
> \score {
>   <<
> \new Staff \with { instrumentName = "Flute" } \FifteenFlute
> \new PianoStaff \with { instrumentName = "Harpsichord" } <<
>   \new Staff \FifteenHarpsUpper
>   \new Staff \FifteenHarpsLower >>
> \new Staff \with { instrumentName = "Violins I" }
> \ScoreFifteenFirstViolinA
>   >>
>   \layout {
>\context { \Score
>   \remove "Timing_translator"
>   \remove "Default_bar_line_engraver"
> }
>\context {
>  \Staff
>  \consists "Timing_translator"
>  \consists "Default_bar_line_engraver"
>}
>\context {
>  \Voice
>  \remove "Forbid_line_break_engraver"
>}
>indent = 26\mm
>  }
> }
> 
> 
> 
> HTH,
>   Harm

Thank you very much for all of that.

Your very first sentence answers my original question: what I had
missed was the fact that there must be a barline (possibly invisible)
in every stave at the musical moment a line break is required.

The ctxMom routine is beyond my understanding, I am afraid, both as
regards the Scheme code and also how it is used.  I can see that it
must be useful if one has a lot of such passages to typeset; but
fortunately I only have this one, and I was able to calculate the
values for the spacer rests myself.  To make sure I was doing it
correctly and also because I am not quite sure yet where I want the
line break to be in the final score, I calculated the values for all
three possible breaks (end of bars 3, 4 and 5).  I then tried inserting
a \break at each of these points in turn.

A break at the end of bar 4 or bar 5 worked fine, but I could not get
Lilypond to allow a break at the end of bar 3.  I eventually concluded
that this must be because of the beam in the flute part, so I removed
it in the code and the line break then worked.  After searching the IR
I discovered that in order to make it work with a beam I needed to add
\once \override Beam.breakable = ##t

I doubt that I shall want a line break at this 

Re: Line-breaking with non-aligned barlines

2018-10-26 Thread Thomas Morley
Am Fr., 26. Okt. 2018 um 18:56 Uhr schrieb Thomas Morley
:

>   << e { s1*15/320 \bar "" \ctxMom s } >>
Well, could be shortened to s1*3/64 and the \ctxMom-command should be
deleted after the duration is found, ofcourse.

Cheers,
  Harm

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


Re: Line-breaking with non-aligned barlines

2018-10-26 Thread Thomas Morley
Am Fr., 26. Okt. 2018 um 18:26 Uhr schrieb David Sumbler :
>
> Below I have shown a compile-able 93 lines (sorry it can't be made much
> shorter) from the files for a much longer piece.
>
> In this particular passage the harpsichord plays 4 bars in strict tempo
> whilst the flute plays 4 bars rubato.  (The 2 lines do not fit and are
> meant to sound terrible together!)
>
> After much effort I have managed to get a layout in the score which
> mimics the original manuscript, but there is one problem I cannot
> solve.  Although these 4 bars can just about be made to fit on to one
> line, there actually needs to be a page break at some point.  This is
> because there is a narrator who has a short speech during the pause at
> the end of the extract.  This will require an inch or two of horizontal
> space, and the 4 bars in question will then be too compressed.  The
> page break should come at the end of one of the harpsichord's bars,
> which correspond to the bars in the rest of the orchestra.  (I have
> only included 1 violin line here; none of the other instruments play
> during the 4 bars in question.)
>
> Unfortunately, every time I ask for a \break Lilypond gives me the
> dreaded
>
> "warning: forced break was overridden by some other event, should you
> be using bar checks?"
>
> I have looked at the Lilypond Snippet "Printing music with different
> time signatures [0.35714]" as well as another relevant snippet, and
> have compiled it successfully.  The line break works as expected.  Yet
> my code produces the warning and refuses to make a line break.
>
> What have I missed?
>
> David
>
> 
> \version "2.19.81"
>
> \language "english"
>
> #(set-global-staff-size 16)
>
> gliss = \markup { \larger \italic "gliss." }
>
> FifteenFlute = {
>   <<
> { \relative {
>   R1 | R1\fermataMarkup |
> \override Staff.TimeSignature.stencil = ##f
> \time 25/16
> \scaleDurations 8/4 { bf''8[(\mf a16]) r }
> \scaleDurations 7/4 { bf8[( a16]) r }
> \scaleDurations 6/4 { bf8[( a16]) r }
> bf8[( a16]) r
> \time 4/4
> \tuplet 5/4 { bf8( c df ef e } fs2
> \time 7/8
> \scaleDurations 7/8 { e4 ds cs bs) }
> \time 9/16
> R1*9/16\fermataMarkup
> \time 4/4
> } }
>   >>
> }
>
> ScoreFifteenFirstViolinA = {
>   <<
> { \relative {
>   d'8(\p\>\glissando^\gliss g)\! r4
>   \override DynamicText.X-offset = #-2
>   g8(\mp\>\glissando^\gliss b)\! r4 |
>   b8(\mf\>\glissando^\gliss d)\! r4
>   \revert DynamicText.X-offset
>   d8(\f\>\glissando^\gliss e)\! r4\fermata |
>   R1*3 | R1\fermataMarkup |
> } }
>   >>
> }
>
> FifteenHarpsUpper = {
>   <<
> { \relative {
>   R1 | R1\fermataMarkup |
>   \key a \major
>   a''16\mf \repeat unfold 9 { gs a } b bs cs d ds e cs a e cs e gs a |
>   \repeat unfold 9 { b as } b cs ds e b gs e8 r \acciaccatura ds' e 
> r\fermata |
> } }
>   >>
> }
>
> FifteenHarpsLower = {
>   <<
> \clef bass
> { \relative {
>R1 | R1\fermataMarkup |
>   \key a \major
>   \clef treble
>   \repeat unfold 4 { a16 e' cs e a e cs e } | \repeat unfold 2 { a, fs' d 
> fs a fs d fs } |
>   gs, e' d e gs e d e gs,8 r \clef bass \acciaccatura ds e r\fermata |
>  } }
>   >>
> }
>
> \score {
>   <<
> \new Staff \with { instrumentName = "Flute" } \FifteenFlute
> \new PianoStaff \with { instrumentName = "Harpsichord" } <<
>   \new Staff \FifteenHarpsUpper
>   \new Staff \FifteenHarpsLower >>
> \new Staff \with { instrumentName = "Violins I" } 
> \ScoreFifteenFirstViolinA
>   >>
>   \layout {
>\context { \Score
>   \remove "Timing_translator"
>   \remove "Default_bar_line_engraver"
> }
>\context {
>  \Staff
>  \consists "Timing_translator"
>  \consists "Default_bar_line_engraver"
>}
>\context {
>  \Voice
>  \remove "Forbid_line_break_engraver"
>}
>indent = 26\mm
>  }
> }
> 

Hi,

you likely know lily breaks only at matching BarLines.
So you have to insert a \bar "" at appropriate place. Which is tricky
here, because there is _no_ appropriate place.

Well, then create one, i.e.
instead of the original event, insert same simultaneous music like
<< e { s \bar "" s } >>
and then figure out which duration the first skip must have.

Which is tricky as well. For that purpose I use:
ctxMom =
  \applyContext
  #(lambda (ctx)
(format #t "\nin context~a: ~a" ctx (ly:context-current-moment ctx)))

and insert \ctxMom where I wrote \break (below I've did it in
FifteenHarpsUpper) and before the second skip of the inserted
simultaneous music in FifteenFlute.
Now I can scale the duration of the first skip until both values of
\ctxMom match.


\version "2.19.81"

ctxMom =
  \applyContext
  #(lambda (ctx)
(format #t "\nin context~a: ~a" ctx (ly:context-current-moment ctx)))



Re: Line-breaking with non-aligned barlines

2018-10-26 Thread Phil Holmes
- Original Message - 
From: "David Sumbler" 

To: 
Sent: Friday, October 26, 2018 4:57 PM
Subject: Line-breaking with non-aligned barlines



Below I have shown a compile-able 93 lines (sorry it can't be made much
shorter) from the files for a much longer piece.


In your example (snipped) I don't see a \break at all and so the piece 
compiles without a problem. 



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


Re: Complex --evaluate command line option

2018-10-26 Thread Thomas Morley
Am Fr., 26. Okt. 2018 um 18:18 Uhr schrieb Hans Åberg :
>
>
> > On 26 Oct 2018, at 17:41, Thomas Morley  wrote:
> >
> > But you could do (at  least on Linux):
> >
> > lilydevel -e "(begin (define myhash (make-hash-table))(hashq-set!
> > myhash 'foo \"bar\"))" file.ly
> >
> > and in file.ly
> >
> > #(use-modules (guile-user))
> > #(write (hashq-ref myhash 'foo))
> >
> > returning "bar" as wished.
>
> The program "lilydevel" is not in the MacOS distribution, though.

Sorry, I rename my lily-versions ...
"lilydevel" is always my latest released devel-version, currently 2.19.82

lilypond -e "(begin (define myhash (make-hash-table))(hashq-set!
myhash 'foo \"bar\"))"
works as well, invoking 2.18.2

Cheers,
  Harm

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


Re: Complex --evaluate command line option

2018-10-26 Thread Hans Åberg

> On 26 Oct 2018, at 18:27, Thomas Morley  wrote:
> 
> Am Fr., 26. Okt. 2018 um 18:18 Uhr schrieb Hans Åberg :
>> 
>> 
>>> On 26 Oct 2018, at 17:41, Thomas Morley  wrote:
>>> 
>>> But you could do (at  least on Linux):
>>> 
>>> lilydevel -e "(begin (define myhash (make-hash-table))(hashq-set!
>>> myhash 'foo \"bar\"))" file.ly
>>> 
>>> and in file.ly
>>> 
>>> #(use-modules (guile-user))
>>> #(write (hashq-ref myhash 'foo))
>>> 
>>> returning "bar" as wished.
>> 
>> The program "lilydevel" is not in the MacOS distribution, though.
> 
> Sorry, I rename my lily-versions ...
> "lilydevel" is always my latest released devel-version, currently 2.19.82

The devel is in the details. :-)



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


Re: Complex --evaluate command line option

2018-10-26 Thread Hans Åberg


> On 26 Oct 2018, at 17:41, Thomas Morley  wrote:
> 
> But you could do (at  least on Linux):
> 
> lilydevel -e "(begin (define myhash (make-hash-table))(hashq-set!
> myhash 'foo \"bar\"))" file.ly
> 
> and in file.ly
> 
> #(use-modules (guile-user))
> #(write (hashq-ref myhash 'foo))
> 
> returning "bar" as wished.

The program "lilydevel" is not in the MacOS distribution, though.



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


Re: Complex --evaluate command line option

2018-10-26 Thread David Kastrup
Peter Anglea  writes:

> I’m trying to use the -e (--evaluate) option to define a hash, not
> just a single variable. For instance
>
>   lilypond -e ‘((define myhash (make-hash-table))(hashq-set!
> myhash ‘foo “bar”))’ file.ly
>
> The above doesn’t work. I think, obviously, it’s breaking at the
> single quote – ‘foo.

Can you try telling your mail client that it shouldn't mangle quotes?
It's hard to guess what you actually wrote.  At any rate, you have an
extra level of parens that is meaning-changing.  Assuming we are talking
about a Bourne-style shell, you probably want to write something like

lilypond -e "(begin (define myhash (make-hash-table))(hashq-set! myhash 'foo 
\"bar\"))' file.ly

Or, if you prefer the other kind of quotes:

lilypond -e '(begin (define myhash (make-hash-table))(hashq-set! myhash '\''foo 
"bar"))' file.ly

Or, evading the problem

lilypond -e '(begin (define myhash (make-hash-table))(hashq-set! myhash (quote 
foo) "bar"))' file.ly

> I’ve tried escaping it with a backslash (\’foo) and a couple other
> things, but nothing seems to work.

Maybe read up on the quoting conventions of your shell?

> Is it possible to run complex Scheme code in the command line option,
> and/or am I just not escaping special characters the right way?

Probably the latter.

-- 
David Kastrup

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


Line-breaking with non-aligned barlines

2018-10-26 Thread David Sumbler
Below I have shown a compile-able 93 lines (sorry it can't be made much
shorter) from the files for a much longer piece.

In this particular passage the harpsichord plays 4 bars in strict tempo
whilst the flute plays 4 bars rubato.  (The 2 lines do not fit and are
meant to sound terrible together!)

After much effort I have managed to get a layout in the score which
mimics the original manuscript, but there is one problem I cannot
solve.  Although these 4 bars can just about be made to fit on to one
line, there actually needs to be a page break at some point.  This is
because there is a narrator who has a short speech during the pause at
the end of the extract.  This will require an inch or two of horizontal
space, and the 4 bars in question will then be too compressed.  The
page break should come at the end of one of the harpsichord's bars,
which correspond to the bars in the rest of the orchestra.  (I have
only included 1 violin line here; none of the other instruments play
during the 4 bars in question.)

Unfortunately, every time I ask for a \break Lilypond gives me the
dreaded

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

I have looked at the Lilypond Snippet "Printing music with different
time signatures [0.35714]" as well as another relevant snippet, and
have compiled it successfully.  The line break works as expected.  Yet
my code produces the warning and refuses to make a line break.

What have I missed?

David


\version "2.19.81"

\language "english"

#(set-global-staff-size 16)

gliss = \markup { \larger \italic "gliss." }

FifteenFlute = {
  <<
{ \relative {
  R1 | R1\fermataMarkup |
\override Staff.TimeSignature.stencil = ##f
\time 25/16
\scaleDurations 8/4 { bf''8[(\mf a16]) r }
\scaleDurations 7/4 { bf8[( a16]) r }
\scaleDurations 6/4 { bf8[( a16]) r }
bf8[( a16]) r 
\time 4/4
\tuplet 5/4 { bf8( c df ef e } fs2 
\time 7/8
\scaleDurations 7/8 { e4 ds cs bs) } 
\time 9/16
R1*9/16\fermataMarkup 
\time 4/4
} }
  >>
}

ScoreFifteenFirstViolinA = {
  <<
{ \relative {
  d'8(\p\>\glissando^\gliss g)\! r4
  \override DynamicText.X-offset = #-2
  g8(\mp\>\glissando^\gliss b)\! r4 |
  b8(\mf\>\glissando^\gliss d)\! r4
  \revert DynamicText.X-offset
  d8(\f\>\glissando^\gliss e)\! r4\fermata |
  R1*3 | R1\fermataMarkup |
} }
  >>
}

FifteenHarpsUpper = {
  <<
{ \relative {
  R1 | R1\fermataMarkup |
  \key a \major
  a''16\mf \repeat unfold 9 { gs a } b bs cs d ds e cs a e cs e gs a |
  \repeat unfold 9 { b as } b cs ds e b gs e8 r \acciaccatura ds' e 
r\fermata |
} }
  >>
}

FifteenHarpsLower = {
  <<
\clef bass
{ \relative {
   R1 | R1\fermataMarkup |
  \key a \major
  \clef treble
  \repeat unfold 4 { a16 e' cs e a e cs e } | \repeat unfold 2 { a, fs' d 
fs a fs d fs } |
  gs, e' d e gs e d e gs,8 r \clef bass \acciaccatura ds e r\fermata |
 } }
  >>
}

\score {
  <<
\new Staff \with { instrumentName = "Flute" } \FifteenFlute
\new PianoStaff \with { instrumentName = "Harpsichord" } <<
  \new Staff \FifteenHarpsUpper
  \new Staff \FifteenHarpsLower >>
\new Staff \with { instrumentName = "Violins I" } \ScoreFifteenFirstViolinA 
  >>
  \layout {
   \context { \Score
  \remove "Timing_translator"
  \remove "Default_bar_line_engraver"
}
   \context {
 \Staff
 \consists "Timing_translator"
 \consists "Default_bar_line_engraver"
   }
   \context {
 \Voice
 \remove "Forbid_line_break_engraver"
   }
   indent = 26\mm
 }
}




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


Re: Complex --evaluate command line option

2018-10-26 Thread Thomas Morley
Am Fr., 26. Okt. 2018 um 16:44 Uhr schrieb Peter Anglea :
>
> I’m trying to use the -e (--evaluate) option to define a hash, not just a 
> single variable. For instance
>
> lilypond -e ‘((define myhash (make-hash-table))(hashq-set! myhash 
> ‘foo “bar”))’ file.ly
>
> The above doesn’t work. I think, obviously, it’s breaking at the single quote 
> – ‘foo.
>
> I’ve tried escaping it with a backslash (\’foo) and a couple other things, 
> but nothing seems to work.
>
> Is it possible to run complex Scheme code in the command line option, and/or 
> am I just not escaping special characters the right way?

Well, from here it looks you used “” ‘’ -signs instead of " and '.
But even with correct ones your example will fail.

But you could do (at  least on Linux):

lilydevel -e "(begin (define myhash (make-hash-table))(hashq-set!
myhash 'foo \"bar\"))" file.ly

and in file.ly

#(use-modules (guile-user))
#(write (hashq-ref myhash 'foo))

returning "bar" as wished.

Otoh, I think the -e option is not very convenient for longer and/or
complex expressions.

Cheers,
  Harm

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


Complex --evaluate command line option

2018-10-26 Thread Peter Anglea
I’m trying to use the -e (--evaluate) option to define a hash, not just a 
single variable. For instance

lilypond -e ‘((define myhash (make-hash-table))(hashq-set! myhash ‘foo 
“bar”))’ file.ly

The above doesn’t work. I think, obviously, it’s breaking at the single quote – 
‘foo. 

I’ve tried escaping it with a backslash (\’foo) and a couple other things, but 
nothing seems to work.

Is it possible to run complex Scheme code in the command line option, and/or am 
I just not escaping special characters the right way?
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Tie shape inside chords: Inconsistent compilation

2018-10-26 Thread Pierre Perol-Schneider
Great! Thank you very much Harm,
Cheers,
Pierre

Le ven. 26 oct. 2018 à 16:13, Thomas Morley  a
écrit :

> Am Fr., 26. Okt. 2018 um 15:41 Uhr schrieb Pierre Perol-Schneider
> :
> >
> > Hi,
> > Please consider the following example:
> >
> > %%
> > \version "2.19.82"
> > music =
> > \fixed c' {
> >   \time 3/8
> >   \voiceOne
> >   4. q
> > }
> > { \music } { \music } { \music }
> > %%
> >
> > After trying several compilation, sometimes the shape command is
> applied, sometimes not.
> > I've found multiple workarounds in the past messages since this problem
> seems to be related to a known tie bug. However none of them seem to work
> in the piece I'm working on.
> > Any idea?
> > TIA, Cheers,
> > Pierre
>
> Hi Pierre,
>
> LilyPond puts in-chord Ties in a TieColumn and performs her own thingy
> according to the procedure 'positioning-done is set to, probably
> dropping a user input for \shape.
> Imho, best you can do is: set positioning-done #t, meaning: "Dear
> LilyPond, don't bother about positioning the Ties, _I_ will do it."
> Ofcourse you _should_ do then. :)
> I.e. the Ties needs a direction. In your example it's done by
> \voiceOne, you could use direction-modifiers ^/_ as well.
> Now apply \shape where you want.
>
> Example with some crazy values:
>
> music =
> \fixed c' {
>   \time 3/8
>   g'-\shape #'((0 . 0) (0 . 0) (1 . 0) (-2 . 2)) ^~
>   >4.
>   \once \override TieColumn.positioning-done = ##t
>   q
> }
> { \music } { \music } { \music }
>
> HTH,
>   Harm
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Tie shape inside chords: Inconsistent compilation

2018-10-26 Thread Thomas Morley
Am Fr., 26. Okt. 2018 um 15:41 Uhr schrieb Pierre Perol-Schneider
:
>
> Hi,
> Please consider the following example:
>
> %%
> \version "2.19.82"
> music =
> \fixed c' {
>   \time 3/8
>   \voiceOne
>   4. q
> }
> { \music } { \music } { \music }
> %%
>
> After trying several compilation, sometimes the shape command is applied, 
> sometimes not.
> I've found multiple workarounds in the past messages since this problem seems 
> to be related to a known tie bug. However none of them seem to work in the 
> piece I'm working on.
> Any idea?
> TIA, Cheers,
> Pierre

Hi Pierre,

LilyPond puts in-chord Ties in a TieColumn and performs her own thingy
according to the procedure 'positioning-done is set to, probably
dropping a user input for \shape.
Imho, best you can do is: set positioning-done #t, meaning: "Dear
LilyPond, don't bother about positioning the Ties, _I_ will do it."
Ofcourse you _should_ do then. :)
I.e. the Ties needs a direction. In your example it's done by
\voiceOne, you could use direction-modifiers ^/_ as well.
Now apply \shape where you want.

Example with some crazy values:

music =
\fixed c' {
  \time 3/8
  4.
  \once \override TieColumn.positioning-done = ##t
  q
}
{ \music } { \music } { \music }

HTH,
  Harm

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


Re: Force text on line without using \textLengthOn

2018-10-26 Thread Kieren MacMillan
p.s.

> I use these to create markups that bypass the horizontal and/or vertical 
> spacing algorithm(s):

Actually, I use those functions to make *any* grob bypass the respective 
spacing algorithm(s)!

Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


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


Re: Force text on line without using \textLengthOn

2018-10-26 Thread Kieren MacMillan
Hi Urs,

Sorry I didn’t get in on this thread earlier — too much going on!

> Without *really* understanding everything I was able to create 
> 'make-with-empty-x-markup' that produces a markup with an empty X and the 
> original Y extent:

Not sure if these functions are helpful to you, but I use these to create 
markups that bypass the horizontal and/or vertical spacing algorithm(s):

ignoreH =
   \propertyTweak horizontal-skylines ##f
   \propertyTweak extra-spacing-width #empty-interval
   \etc

ignoreV =
   \propertyTweak vertical-skylines ##f
   \propertyTweak extra-spacing-height #empty-interval
   \etc

ignore = \ignoreH \ignoreV \etc

Just in case they’re helpful!
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


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


Re: Force text on line without using \textLengthOn

2018-10-26 Thread Urs Liska

Hi Harm


Am 26.10.2018 um 13:58 schrieb Thomas Morley:

Hi Urs,

currently I've not the time to dive deeper in your code, maybe later
today or during the upcoming weekend.
For now only about:

Am Fr., 26. Okt. 2018 um 11:54 Uhr schrieb Urs Liska :

Additionally (but this is already present
in your code) when using make-with-dimensions-markup (where is this
defined? I don't find this with git grep???)


Thank you for these explanations. Without *really* understanding 
everything I was able to create 'make-with-empty-x-markup' that produces 
a markup with an empty X and the original Y extent:


%%%
#(define-markup-command (with-empty-x layout props arg)(markup?)
   "Create a markup with empty X and native Y extent."
   (let*
((stencil (interpret-markup layout props arg))
 (y-extent (ly:stencil-extent stencil Y)))
(ly:stencil-outline
 stencil
 (make-filled-box-stencil '(0 . 0) y-extent
%%%

and replace the call with (basically)

-\tweak bound-details.left.text #(make-with-empty-x-markup txt))

This makes the problem of the vertical alignment and extent go away, but 
of course not the horizontal aspects.


Best
Urs

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


Tie shape inside chords: Inconsistent compilation

2018-10-26 Thread Pierre Perol-Schneider
Hi,
Please consider the following example:

%%
\version "2.19.82"
music =
\fixed c' {
  \time 3/8
  \voiceOne
  4. q
}
{ \music } { \music } { \music }
%%

After trying several compilation, sometimes the shape command is applied,
sometimes not.
I've found multiple workarounds in the past messages since this problem
seems to be related to a known tie bug. However none of them seem to work
in the piece I'm working on.
Any idea?
TIA, Cheers,
Pierre
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force text on line without using \textLengthOn

2018-10-26 Thread Thomas Morley
Hi Urs,

currently I've not the time to dive deeper in your code, maybe later
today or during the upcoming weekend.
For now only about:

Am Fr., 26. Okt. 2018 um 11:54 Uhr schrieb Urs Liska :
> Additionally (but this is already present
> in your code) when using make-with-dimensions-markup (where is this
> defined? I don't find this with git grep???)

For demonstration purpose I use make-italic-markup, less typing ;)

If you define a markup command using the macro 'define-markup-command'
from 'markup-macros.scm', then this macro returns two procedures.
>From its doc-string (shortened)
"
* Define a COMMAND-markup function after command-and-args and body
* define a make-COMMAND-markup function.
"

So after having done
(define-markup-command (italic layout props arg) ...)
we get the procedures 'italic-markup' and 'make-italic-markup'

How they differ can be watched easily by displaying them in the scheme-sandbox:

guile> (display make-italic-markup)
#

guile> (display italic-markup)
#
(lambda args
  (#
   italic-markup
   "make-italic-markup"
   args))


#(pretty-print (procedure-source italic-markup))
->
(lambda (layout props arg)
  "(arg)
Use italic @code{font-shape} for @var{arg}.

@lilypond[verbatim,quote]
\\markup {
  default
  \\hspace #2
  \\italic
  italic
}
@end lilypond"
  (let ()
(interpret-markup
  layout
  (prepend-alist-chain
'font-shape
'italic
props)
  arg)))
The latter returns the code from define-markup-commands.

Apart from that we have this syntax as well:
(markup #:italic "foo")
with:
#(pretty-print (markup #:italic "foo"))
returning a procedure(!)
(#
 ((#
   "foo")))
callable in a ly-file with $(markup #:italic "foo")

So the italic-markup is wrapped into a line-markup and the
"markup-mode" provides the layout/props-arguments.

All pretty confusing at first glance, but I've found use-cases for all
possibilities.


For basic use: if you happen to see some 'make-whatever-markup' drop
'make-' and '-markup' and see the name of the markup-command-name as
defined in the source or by the user.

HTH a bit,
  Harm

[1]
Regrettable 'procedure-source' is disabled in guilev2, see the thread
starting here:
https://lists.gnu.org/archive/html/guile-user/2012-09/msg00020.html
With the consequence our display-lily-procedures will not always work as before:

\void
\displayLilyMusic
\applyContext #(lambda (ctx) (ly:context-set-property ctx 'fontSize 6))

with guilev1:
\applyContext #(lambda (ctx)
  (ly:context-set-property ctx (quote fontSize) 6))

with guilev2:
\applyContext ##f

I already tried to implement something like ly:procedure-source in
general-scheme.cc based on the old guilev1-coding.
Not sure if it would be possible at all. But pretty sure it's
impossible for me with my lack of C++-knowledge.

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


Re: Force text on line without using \textLengthOn

2018-10-26 Thread Davide Liessi
Il giorno ven 26 ott 2018 alle ore 11:55 Urs Liska
 ha scritto:
> make-with-dimensions-markup (where is this
> defined? I don't find this with git grep???)

`git grep with-dimensions` finds
scm/define-markup-commands.scm:(define-markup-command (with-dimensions
layout props x y arg)

I might have a similar problem, i.e., automatically add
\stopTextSpanner commands to mimick \tempo with TextSpanner (see
https://lists.gnu.org/archive/html/lilypond-user/2018-10/msg00238.html)
Although I can offer no insights at present, I'm definitely interested.

Best wishes.
Davide

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


Re: Force text on line without using \textLengthOn

2018-10-26 Thread Urs Liska

Hi Harm,


Am 25.10.2018 um 23:38 schrieb Thomas Morley:

Hi Urs,

Am Do., 25. Okt. 2018 um 17:49 Uhr schrieb Urs Liska :

...


> Hi Urs,

> from your description it sounds you need sort of a spanner with
> adjustable length.
> Attached some coding hacking TextSpanner.
> What do you think?


I didn't understand the code in detail, but am I right that

the code basically prints the texts as the start of a TextSpanner

Yes


\endTextSpanners parses a music expression and adds a \stopTextSpan 
automatically for any \startTextSpan

Not exactly, the first event with \startTextSpan is disregarded, all
other events with \startTextSpan get a \stopTextSpan added. The last
note/rest/skip/eventchord gets a \stopTextSpan as well.


OK. I don't really understand the handling of first and last events 
here, but I think I don't need this approach anyway.





\testII creates such a \startTextSpan to be processed by  \endTextSpanners

Yes


?

If so this means that all the music must be wrapped in an \endTextSpanners 
expression, isn't it?

Not exactly.
The proposed code/example does so, yes.
Though, \endTextSpanners is more for conveniance., you could drop
\endTextSpanners entirely and set \stopTextSpan manually.


I had a try that *seemed* to be successful, see below


If this is true then I would be quite a stretch to integrate this solution into 
my environment, because the input files are part of the edition in this case. 
They will be made available within a TEI file and therefore have to be 
extremely clean. So far there is exactly one \include and then either a single 
music expression (for a single-voice music example) or several music variables 
plus a custom \loadTemplate command that loads a file with a \score block to 
make use of the music variables.

For the first case (simple music expression) I can achieve the result by calling 
\endTextSpanners at the very end of the include file so the music expression will be 
used as the argument for the function. But for the other cases I'm not sure how I could 
arrange my files. In addition I only need this functionality in a subset of my >560 
files, but such a solution could probably not be optional in the way I'm doing it 
elsewhere in the project. (The main include file loads a -include.ily 
file if that is present on disk. Within that optional file I can place a layout block, 
edition-engraver mods and an arbitrary number of \loadTool commands. While this latter 
function probably isn't necessary for efficiency reasons (it would probably be easier to 
simply include all the available code for each compiled file), it is a nice way to 
document the specific needs of an example.)


Well, I'm not familiar with TEI, the edition-engraver, etc.
Sorry.


That's not necessary here. All I wanted to point out is that I need 
"clean" input files and a generic structure where I can't wrap the music 
variables in an arbitrary function call. The reference to the TEI is 
only that the primary input file's content will be included in the 
edition and should be stripped of any code that is only needed for 
rendering purposes. Eventually the project will be publicly available, 
and I'll probably write about it so it'll become clearer what this is 
about ...




I think I'll do some more experiments with the code itself before trying to 
integrate this.

Hm, as said I don't fully understand the code. But if I'm not mistaken 
\endTextSpanners works by first identifying a music expression that holds a 
\startTextSpan event and then adding a \stopTextSpan event to the note, rest or 
chord. Would it be possible to achieve the same thing directly from a 
music-function or event-function? Maybe if \testII wouldn't be an event 
function but a music-function taking the note/rest/chord as an argument, like

   \testII ##t "John Doe" c'

where the TextSpanner is added to the c' ?

Well, you can't start _and_ end a TextSpanner on the same event. See
the warning for { c'1\startTextSpan\stopTextSpan }.
Thus the sophisticated endTextSpanner. Ofcourse endTextSpanner can't
end a textSpanner which is started at the last note of a file as well.

It's thinkable to create a music-functions taking a musical argument
and doing something like
{ \myFunction c'1 }
-> { c'1\startTextSpan <>\stopTextSpan }
This will return a warning if at happens at the end of a file, though.


I copied all relevant code to a different structure, and while it 
compiles and produces the spanners as desired there are still problems.


%%%
\version "2.19.82"

#(define (minimum-length-from-stencil process-string?)
   ;; Set the minimum-length of a grob, which is supposed to be a TextSpanner,
   ;; to the length of the stencil of bound-details.left.text plus 0.1
   (lambda (grob)
 (let* ((bound-details (ly:grob-property grob 'bound-details))
(lft (assoc-get 'left bound-details))
(txt (assoc-get 'text lft))
(txt-stil
 (if (markup? txt)
 (grob-interpret-markup
 

Re: Edition Engraver regex/wildcard bug

2018-10-26 Thread Jan-Peter Voigt
Hi Mark,

thank you for bringing this up! Until now I wasn't aware of this issue,
but in fact it is one.
And I have an idea where the problem is buried.
For now I opened an issue:
https://github.com/openlilylib/edition-engraver/issues/26

Hope to solve it soon!

Jan-Peter

Am 25.10.18 um 21:28 schrieb Mark Knoop:
> Apologies if this is a known issue, but I think I've found a bug in the 
> regex/wildcard handling of edition engraver paths.
>
> It seems that mixing editionMods with normal paths together with those formed 
> with wildcards and/or regular expressions causes the wildcard/regex 
> editionMods to break. This is using code adapted from 
> usage-examples/development-3.ly. 
>
> A workaround is of course to simply use wildcards or regexes in all 
> editionMods, but this seems arcane.
>
> %%%
> \version "2.19.82"
> \include "oll-core/package.ily"
> \loadPackage edition-engraver
> \consistToContexts #edition-engraver Score.Staff.Voice.Lyrics
> \addEdition test
>
> % { comment this block for green noteheads
> \editionMod test 1 0/4 la.Voice \once \override NoteHead.color = #red
> \editionMod test 2 0/4 le.Voice \once \override NoteHead.color = #blue
> %}
> \editionMod test 3 0/4 "{l*}".Voice \once \override NoteHead.color = #green
> \editionMod test 4 0/4 "/l.*/".Voice \once \override NoteHead.color = #green
>
> %{ workaround using regular expressions
> \editionMod test 1 1/4 "/^la$/".Voice \once \override NoteHead.color = #red
> \editionMod test 2 1/4 "/^le$/".Voice \once \override NoteHead.color = #blue
> %}
> %{ workaround using wildcards
> \editionMod test 1 2/4 "{la}".Voice \once \override NoteHead.color = #red
> \editionMod test 2 2/4 "{le}".Voice \once \override NoteHead.color = #blue
> %}
>
> <<
>   \new Staff \with {
> \editionID le
>   } \repeat unfold 24 e''4
>   \new Staff \with {
> \editionID la
>   } \repeat unfold 24 e''4
> %%%
>


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