Re: Piping contents of SVG directly to stdout

2022-07-18 Thread DoubleFelix
So I have my Ubuntu VM setup and per the link from Jean, I've ran autogen,
but when I try to do "../configure --enable-cairo-backend", it says
"configure: error: no acceptable C compiler found in $PATH". How should I
fix this?

On Mon, Jul 18, 2022 at 2:57 PM Silvain Dupertuis <
silvain-dupert...@bluewin.ch> wrote:

> It'll be interesting to be able to ouput SVG directly to get snippet which
> can be integrated into other documents.
>
> Actually, one can get SVG files using Inkscape : import the PDF file
> (using PopplerCairo orption),  edit at will, select parts, crop, etc. and
> save as SVG.
>
> This is what I did for this experimental page
> .
> I used one LilyPond file, produced one PDF page output, which I edited with
> Inkscpae to cut it into 3 SVG files to include in my HTML page.
>
> On the other side, you can put LilyPond code into OOoLilyPond extension
> for LibreOffice. It produces SVG code (and you can save the image as SVG),
> and these images can be used directly in the OpenDocument file to include
> them into some textual explanation...
>
> I would be interested in a web extension which would interpret directly
> Lilypond code into SVG files, it that is possible...
>
> *Silvain*
>
> Le 18.07.22 à 20:33, David Wright a écrit :
>
> On Mon 18 Jul 2022 at 11:28:26 (-0500), DoubleFelix wrote:
>
> Felix, I’m curious what you mean by cropping the file. Sounds to me like
> you are trying to just write a small snippet of music, maybe a few
> measures, and not have the output flooded by whitespace all around the size
> of an A4 paper? This is also similar to what I was using lilypond for and
> there are ways to do this without any external apps.
>
>
> Actually this is exactly what I'm trying to do. My current setup uses a
> python library called svgpathtools to get the bounding box, then I do some
> basic manipulation of the width, height, and viewbox parameters to trim all
> of the excess whitespace out. Although I am very interested in  can
> do this without any additional utilities.
>
> I thought this ought to be very simple.
>
> The attached are shamelessly plundered 
> fromhttps://lists.gnu.org/archive/html/lilypond-user/2021-01/msg00075.html
>
> (There will be files generated, with names not including ".cropped.",
> that need to be thrown away.)
>
> Cheers,
> David.
>
>
> --
> Silvain Dupertuis
> Route de Lausanne 335
> 1293 Bellevue (Switzerland)
> tél. +41-(0)22-774.20.67
> portable +41-(0)79-604.87.52
> web: silvain-dupertuis.org 
>


Re: tremolo: 4/4 time, 2 half notes, single-slash tremolo question

2022-07-18 Thread William Rehwinkel
Great, glad you could get it working Kenneth. Speaking for myself, I 
found it easiest to think of \repeat tremolo in the same way as the 
other \repeat commands... the first number is how many times the note 
repeats.


-William

On 7/18/22 20:44, Kenneth Wolcott wrote:

Hi William;

   Thank you! That is exactly what I needed.  I still don't have the
formula down pat, but I'll work on it until it is automatically
correct.

Ken

On Mon, Jul 18, 2022 at 5:40 PM William Rehwinkel
 wrote:

Hey Kenneth,

I think you may want to write `\repeat tremolo 4` instead of 2, because
that will signify four repeating eighth notes, which will result in the
time of a half note...unless i am misunderstanding.

Thanks,

-William

On 7/18/22 20:34, Kenneth Wolcott wrote:

Hi;

I was able to generate two half-note, single-slashed tremolos in 4/4
time using the colon syntax, but do not understand how to get the same
effect with the repeat tremolo syntax:

\repeat tremolo 2 8 \repeat tremolo 2 8  | % m01
2:8 q:8 | % m02

bar #2 is correct where bar #1 results in the following bar check warning:

Swan_Lake.ly:110:64: warning: barcheck failed at: 1/2
\repeat tremolo 2 8 \repeat tremolo 2 8
 | % m01

I'd like to use the repeat tremolo syntax because I'd like midi output
to reflect the tremolo where the colon syntax is not understood for
midi output.

I'm apparently not doing the math correctly.

4/4 time, half notes, two 8th note tremolos

Thanks,
Ken Wolcott

--
William Rehwinkel

will...@williamrehwinkel.net
https://williamrehwinkel.net



--
William Rehwinkel

will...@williamrehwinkel.net
https://williamrehwinkel.net




Re: tremolo: 4/4 time, 2 half notes, single-slash tremolo question

2022-07-18 Thread Kenneth Wolcott
Hi William;

  Thank you! That is exactly what I needed.  I still don't have the
formula down pat, but I'll work on it until it is automatically
correct.

Ken

On Mon, Jul 18, 2022 at 5:40 PM William Rehwinkel
 wrote:
>
> Hey Kenneth,
>
> I think you may want to write `\repeat tremolo 4` instead of 2, because
> that will signify four repeating eighth notes, which will result in the
> time of a half note...unless i am misunderstanding.
>
> Thanks,
>
> -William
>
> On 7/18/22 20:34, Kenneth Wolcott wrote:
> > Hi;
> >
> >I was able to generate two half-note, single-slashed tremolos in 4/4
> > time using the colon syntax, but do not understand how to get the same
> > effect with the repeat tremolo syntax:
> >
> >\repeat tremolo 2 8 \repeat tremolo 2 8  | % m01
> >2:8 q:8 | % m02
> >
> > bar #2 is correct where bar #1 results in the following bar check warning:
> >
> > Swan_Lake.ly:110:64: warning: barcheck failed at: 1/2
> >\repeat tremolo 2 8 \repeat tremolo 2 8
> > | % m01
> >
> > I'd like to use the repeat tremolo syntax because I'd like midi output
> > to reflect the tremolo where the colon syntax is not understood for
> > midi output.
> >
> >I'm apparently not doing the math correctly.
> >
> >4/4 time, half notes, two 8th note tremolos
> >
> > Thanks,
> > Ken Wolcott
>
> --
> William Rehwinkel
>
> will...@williamrehwinkel.net
> https://williamrehwinkel.net
>
>



Re: tremolo: 4/4 time, 2 half notes, single-slash tremolo question

2022-07-18 Thread William Rehwinkel

Hey Kenneth,

I think you may want to write `\repeat tremolo 4` instead of 2, because 
that will signify four repeating eighth notes, which will result in the 
time of a half note...unless i am misunderstanding.


Thanks,

-William

On 7/18/22 20:34, Kenneth Wolcott wrote:

Hi;

   I was able to generate two half-note, single-slashed tremolos in 4/4
time using the colon syntax, but do not understand how to get the same
effect with the repeat tremolo syntax:

   \repeat tremolo 2 8 \repeat tremolo 2 8  | % m01
   2:8 q:8 | % m02

bar #2 is correct where bar #1 results in the following bar check warning:

Swan_Lake.ly:110:64: warning: barcheck failed at: 1/2
   \repeat tremolo 2 8 \repeat tremolo 2 8
| % m01

I'd like to use the repeat tremolo syntax because I'd like midi output
to reflect the tremolo where the colon syntax is not understood for
midi output.

   I'm apparently not doing the math correctly.

   4/4 time, half notes, two 8th note tremolos

Thanks,
Ken Wolcott


--
William Rehwinkel

will...@williamrehwinkel.net
https://williamrehwinkel.net




tremolo: 4/4 time, 2 half notes, single-slash tremolo question

2022-07-18 Thread Kenneth Wolcott
Hi;

  I was able to generate two half-note, single-slashed tremolos in 4/4
time using the colon syntax, but do not understand how to get the same
effect with the repeat tremolo syntax:

  \repeat tremolo 2 8 \repeat tremolo 2 8  | % m01
  2:8 q:8 | % m02

bar #2 is correct where bar #1 results in the following bar check warning:

Swan_Lake.ly:110:64: warning: barcheck failed at: 1/2
  \repeat tremolo 2 8 \repeat tremolo 2 8
   | % m01

I'd like to use the repeat tremolo syntax because I'd like midi output
to reflect the tremolo where the colon syntax is not understood for
midi output.

  I'm apparently not doing the math correctly.

  4/4 time, half notes, two 8th note tremolos

Thanks,
Ken Wolcott


Re: Piping contents of SVG directly to stdout

2022-07-18 Thread Silvain Dupertuis
It'll be interesting to be able to ouput SVG directly to get snippet which can be 
integrated into other documents.


Actually, one can get SVG files using Inkscape : import the PDF file (using PopplerCairo 
orption),  edit at will, select parts, crop, etc. and save as SVG.


This is what I did for this experimental page 
. I used 
one LilyPond file, produced one PDF page output, which I edited with Inkscpae to cut it 
into 3 SVG files to include in my HTML page.


On the other side, you can put LilyPond code into OOoLilyPond extension for LibreOffice. 
It produces SVG code (and you can save the image as SVG), and these images can be used 
directly in the OpenDocument file to include them into some textual explanation...


I would be interested in a web extension which would interpret directly Lilypond code into 
SVG files, it that is possible...


/Silvain/


Le 18.07.22 à 20:33, David Wright a écrit :

On Mon 18 Jul 2022 at 11:28:26 (-0500), DoubleFelix wrote:

Felix, I’m curious what you mean by cropping the file. Sounds to me like
you are trying to just write a small snippet of music, maybe a few
measures, and not have the output flooded by whitespace all around the size
of an A4 paper? This is also similar to what I was using lilypond for and
there are ways to do this without any external apps.


Actually this is exactly what I'm trying to do. My current setup uses a
python library called svgpathtools to get the bounding box, then I do some
basic manipulation of the width, height, and viewbox parameters to trim all
of the excess whitespace out. Although I am very interested in  can
do this without any additional utilities.

I thought this ought to be very simple.

The attached are shamelessly plundered from
https://lists.gnu.org/archive/html/lilypond-user/2021-01/msg00075.html

(There will be files generated, with names not including ".cropped.",
that need to be thrown away.)

Cheers,
David.



--
Silvain Dupertuis
Route de Lausanne 335
1293 Bellevue (Switzerland)
tél. +41-(0)22-774.20.67
portable +41-(0)79-604.87.52
web: silvain-dupertuis.org 

Re: Piping contents of SVG directly to stdout

2022-07-18 Thread DoubleFelix
My gosh it's that simple. I feel laughably stupid right now.

On Mon, Jul 18, 2022 at 1:33 PM David Wright 
wrote:

> On Mon 18 Jul 2022 at 11:28:26 (-0500), DoubleFelix wrote:
> >
> > > Felix, I’m curious what you mean by cropping the file. Sounds to me
> like
> > > you are trying to just write a small snippet of music, maybe a few
> > > measures, and not have the output flooded by whitespace all around the
> size
> > > of an A4 paper? This is also similar to what I was using lilypond for
> and
> > > there are ways to do this without any external apps.
> > >
> >
> > Actually this is exactly what I'm trying to do. My current setup uses a
> > python library called svgpathtools to get the bounding box, then I do
> some
> > basic manipulation of the width, height, and viewbox parameters to trim
> all
> > of the excess whitespace out. Although I am very interested in how you
> can
> > do this without any additional utilities.
>
> I thought this ought to be very simple.
>
> The attached are shamelessly plundered from
> https://lists.gnu.org/archive/html/lilypond-user/2021-01/msg00075.html
>
> (There will be files generated, with names not including ".cropped.",
> that need to be thrown away.)
>
> Cheers,
> David.
>


Re: Piping contents of SVG directly to stdout

2022-07-18 Thread William
Thanks for this, David. As unfortunately my method (set \header{tagline=##f} 
and run lilypond -dbackend=eps —png file.ly) doesn’t work for SVGs. 

-William

Sent from my iPhone

> On Jul 18, 2022, at 14:36, David Wright  wrote:
> 
> On Mon 18 Jul 2022 at 11:28:26 (-0500), DoubleFelix wrote:
>> 
>>> Felix, I’m curious what you mean by cropping the file. Sounds to me like
>>> you are trying to just write a small snippet of music, maybe a few
>>> measures, and not have the output flooded by whitespace all around the size
>>> of an A4 paper? This is also similar to what I was using lilypond for and
>>> there are ways to do this without any external apps.
>>> 
>> 
>> Actually this is exactly what I'm trying to do. My current setup uses a
>> python library called svgpathtools to get the bounding box, then I do some
>> basic manipulation of the width, height, and viewbox parameters to trim all
>> of the excess whitespace out. Although I am very interested in how you can
>> do this without any additional utilities.
> 
> I thought this ought to be very simple.
> 
> The attached are shamelessly plundered from
> https://lists.gnu.org/archive/html/lilypond-user/2021-01/msg00075.html
> 
> (There will be files generated, with names not including ".cropped.",
> that need to be thrown away.)
> 
> Cheers,
> David.
> 
> 
> 
> 




Re: Piping contents of SVG directly to stdout

2022-07-18 Thread David Wright
On Mon 18 Jul 2022 at 11:28:26 (-0500), DoubleFelix wrote:
> 
> > Felix, I’m curious what you mean by cropping the file. Sounds to me like
> > you are trying to just write a small snippet of music, maybe a few
> > measures, and not have the output flooded by whitespace all around the size
> > of an A4 paper? This is also similar to what I was using lilypond for and
> > there are ways to do this without any external apps.
> >
> 
> Actually this is exactly what I'm trying to do. My current setup uses a
> python library called svgpathtools to get the bounding box, then I do some
> basic manipulation of the width, height, and viewbox parameters to trim all
> of the excess whitespace out. Although I am very interested in how you can
> do this without any additional utilities.

I thought this ought to be very simple.

The attached are shamelessly plundered from
https://lists.gnu.org/archive/html/lilypond-user/2021-01/msg00075.html

(There will be files generated, with names not including ".cropped.",
that need to be thrown away.)

Cheers,
David.
\new Score {
c'1
d'1
e'1
}
\new Score {
c'1
\break
c'1
\break
c'1
}

\new Score {
d'1
\break
d'1
\break
d'1
}

\new Score {
c'1
\break
c'1
\break
c'1
}

\new Score {
d'1
\break
d'1
\break
d'1
}

\new Score {
c'1
\break
c'1
\break
c'1
}

\new Score {
d'1
\break
d'1
\break
d'1
}

\new Score {
c'1
\break
c'1
\break
c'1
}

\new Score {
d'1
\break
d'1
\break
d'1
}

\new Score {
c'1
\break
c'1
\break
c'1
}

\new Score {
d'1
\break
d'1
\break
d'1
}


Re: Code pointer from end-BarLine to previous NoteHead.?

2022-07-18 Thread David Kastrup
Thomas Morley  writes:

> I will not vanish from the list/project in the foreseeable future,
> unless hit by bus...
>
> Though in my humble opinion meaningful error messages are the most
> pressing issue and I don't see I could do anything to improve the
> situation.
> That is frustrating, furthermore I was stuck in a huge coding I could
> not debug, because of those not-messages.
> (I'll insert some german words now, not knowing them in english).
> Every time I get such a not-message it feels like "Verarschung".

"getting bullshitted", more or less.  With a similar departure from
polite discourse due to the raised emotions.

> At the end of a day I feel not frustrated but realy pissed.
>
> Sometimes writing about that is a possbility come down a bit, even at
> the risk someone gives me a "Kopfnuss". ;)

rap/whack on the head.

> Nevertheless, did you read
> https://lists.gnu.org/archive/html/lilypond-user/2022-07/msg00234.html
> ?
> Thanks Jean, I found a possibility to workaround.
>
> That said, ...
> It shouldn't be that hard to code with guilev2 in LilyPond.

Well, we start mostly with reaping the drawbacks because the benefits
require more rewriting of LilyPond.

Yes, getting the debugging into saner shape would appear important.

-- 
David Kastrup



Re: Code pointer from end-BarLine to previous NoteHead.?

2022-07-18 Thread Thomas Morley
Am Mo., 18. Juli 2022 um 18:43 Uhr schrieb Lukas-Fabian Moser :
>
> Forgive me for piping up:
> > I'm not able to say what happened, I'm not able to debug because of
> > that unhelpful (oh, I'm very polite this evening) guile messages, see
> > the other thread.
> >
> > I'm overtired like hell, close to trashing the whole project, and
> > close to advertising everyone to not use LilyPond for huge custom
> > codings.
>
> That would be a pity, seeing as you're one of the most virtuoso
> suppliers of non-trivial LilyPond scheme extensions.
>
> I regularly switch back to old Guile v1.8 LilyPond versions (that's very
> easy in Frescobaldi) if my Scheme code gets to complicated for me - this
> happens quite often :-) - and I want to have meaningful debug messages.
> Maybe that's a compromise one has to make for the time being.
>
> In any case, please don't let yourself get frustrated: Remember how lots
> of people were very grateful for your experiences and insights regarding
> extending LilyPond you could share in Salzburg two years ago; they are
> even more important since you declare yourself to be "not a programmer",
> if I recall correctly, and hence probably closer to the LilyPond users
> without a computer science/maths/... background than most people on this
> list (and certainly on -devel) are. This project needs you. :-)
>
> Hang on in there!
>
> Lukas
>

Hi Lukas,

I will not vanish from the list/project in the foreseeable future,
unless hit by bus...

Though in my humble opinion meaningful error messages are the most
pressing issue and I don't see I could do anything to improve the
situation.
That is frustrating, furthermore I was stuck in a huge coding I could
not debug, because of those not-messages.
(I'll insert some german words now, not knowing them in english).
Every time I get such a not-message it feels like "Verarschung". At
the end of a day I feel not frustrated but realy pissed.

Sometimes writing about that is a possbility come down a bit, even at
the risk someone gives me a "Kopfnuss". ;)

Nevertheless, did you read
https://lists.gnu.org/archive/html/lilypond-user/2022-07/msg00234.html
?
Thanks Jean, I found a possibility to workaround.

That said, ...
It shouldn't be that hard to code with guilev2 in LilyPond.

Cheers,
  Harm



Re: Code pointer from end-BarLine to previous NoteHead.?

2022-07-18 Thread Lukas-Fabian Moser

Forgive me for piping up:

I'm not able to say what happened, I'm not able to debug because of
that unhelpful (oh, I'm very polite this evening) guile messages, see
the other thread.

I'm overtired like hell, close to trashing the whole project, and
close to advertising everyone to not use LilyPond for huge custom
codings.


That would be a pity, seeing as you're one of the most virtuoso 
suppliers of non-trivial LilyPond scheme extensions.


I regularly switch back to old Guile v1.8 LilyPond versions (that's very 
easy in Frescobaldi) if my Scheme code gets to complicated for me - this 
happens quite often :-) - and I want to have meaningful debug messages. 
Maybe that's a compromise one has to make for the time being.


In any case, please don't let yourself get frustrated: Remember how lots 
of people were very grateful for your experiences and insights regarding 
extending LilyPond you could share in Salzburg two years ago; they are 
even more important since you declare yourself to be "not a programmer", 
if I recall correctly, and hence probably closer to the LilyPond users 
without a computer science/maths/... background than most people on this 
list (and certainly on -devel) are. This project needs you. :-)


Hang on in there!

Lukas




Re: Piping contents of SVG directly to stdout

2022-07-18 Thread DoubleFelix
To William:

> Felix, I’m curious what you mean by cropping the file. Sounds to me like
> you are trying to just write a small snippet of music, maybe a few
> measures, and not have the output flooded by whitespace all around the size
> of an A4 paper? This is also similar to what I was using lilypond for and
> there are ways to do this without any external apps.
>

Actually this is exactly what I'm trying to do. My current setup uses a
python library called svgpathtools to get the bounding box, then I do some
basic manipulation of the width, height, and viewbox parameters to trim all
of the excess whitespace out. Although I am very interested in how you can
do this without any additional utilities.

To Henning Hraban Ramm:

> I never used the SVG backend, but maybe the lilypond-book header works
> with it, too?
> It helps to create small snippets, I used the following settings in my
> LilyPond setup for ConTeXt:
>
...
>

I gave this a go and it still seems to generate a large amount of
whitespace.

On Mon, Jul 18, 2022 at 1:44 AM Henning Hraban Ramm 
wrote:

> Am 18.07.22 um 06:39 schrieb William:
> > Felix, I’m curious what you mean by cropping the file. Sounds to me like
> > you are trying to just write a small snippet of music, maybe a few
> > measures, and not have the output flooded by whitespace all around the
> > size of an A4 paper? This is also similar to what I was using lilypond
> > for and there are ways to do this without any external apps.
>
> I never used the SVG backend, but maybe the lilypond-book header works
> with it, too?
> It helps to create small snippets, I used the following settings in my
> LilyPond setup for ConTeXt:
>
> % --- start of setup for single-line output files ---
> #(define default-toplevel-book-handler
>print-book-with-defaults-as-systems )
>
> #(define toplevel-book-handler
>(lambda ( . rest)
>(set! output-empty-score-list #f)
>(apply print-book-with-defaults rest)))
>
> #(define toplevel-music-handler
>(lambda ( . rest)
> (apply collect-music-for-book rest)))
>
> #(define toplevel-score-handler
>(lambda ( . rest)
> (apply collect-scores-for-book rest)))
>
> #(define toplevel-text-handler
>(lambda ( . rest)
> (apply collect-scores-for-book rest)))
>
> #(set! output-empty-score-list #t)
>
> % --- stop single-line setup ---
>
>
> Hraban
>
>
>


Re: color change working in only upper staff

2022-07-18 Thread Pierre Perol-Schneider
Hi William, hi Jim,

Le lun. 18 juil. 2022 à 16:38, William Rehwinkel <
will...@williamrehwinkel.net> a écrit :

> Hey Jim,
>
> To be honest, I'm not sure why the example you posted doesn't work, but I
> was able to find a workaround by using \contexts to apply the override to
> each staff, like so.
>
Using << { } // { } >> creates additional voices, so that pevious
oveerides  cannot apply

> \version "2.20.0"
>
> upper = \relative c'' { % remove \override
>   \clef treble
>   \key c \major
>   \time 4/4
>
> a-1 cis' \tuplet 3/2 {8~ }
>
>
> }
>
> lower = \relative c { % remove \override
>   \clef bass
>   \key c \major
>   \time 4/4
>
> <<{f'1}-2\\{r4. e32-1 cis-2 a-4 f-1 d2-2}>>
>
> }
>
> \score {
>   \new PianoStaff <<
> \set PianoStaff.instrumentName = #"Piano  "
> \new Staff = "upper" \upper
> \new Staff = "lower" \lower
>   >>
>   *\layout { *
> *\context {*
> *\Staff*
> *\override Fingering.color = #red*
> *}*
> *  }*
>   \midi { }
> }
>
Staff context is not needed here (see
https://lilypond.org/doc/v2.20/Documentation/internals/fingering_005fengraver
)

Here's a modified code with few shorcuts:

\version "2.20"

upper = \relative { %% <= c'' not needed
  %\override Fingering.color = #red
  %\clef treble %% <= default clef, not needed
  \key c \major
  %\time 4/4 %% <= default time signature, not needed
  a'-1 cis'  \tuplet 3/2 { 8~ q q } %% <= shorter chords
}

lower = \relative { %% <= c not needed
  %\override Fingering.color = #red
  \clef bass
  \key c \major
  %\time 4/4 %% <= default time signature, not needed
  << { f'1-2 } \\ { r4. e32-1 cis-2 a-4 f-1 d2-2 } >>
}

\score {
  \new PianoStaff <<
%\set PianoStaff.instrumentName = #"Piano  " %% <= see hereunder
\new Staff = "upper" \upper
\new Staff = "lower" \lower
  >>
  \layout {
\context {
\Voice
\override Fingering.color = #red
}
\context {
\PianoStaff
instrumentName = #"Piano"
\override InstrumentName.padding = #2 %% <= more accurate than
spaces
}
  }
  \midi { }
}

Cheers,
Pierre


Re: color change working in only upper staff

2022-07-18 Thread Pierre Perol-Schneider
Hi William, hi Jim,


Le lun. 18 juil. 2022 à 16:38, William Rehwinkel <
will...@williamrehwinkel.net> a écrit :

> Hey Jim,
>
> To be honest, I'm not sure why the example you posted doesn't work, but I
> was able to find a workaround by using \contexts to apply the override to
> each staff, like so.
>
Using << { } // { } >> creates addition


> \version "2.20.0"
>
> upper = \relative c'' { % remove \override
>   \clef treble
>   \key c \major
>   \time 4/4
>
> a-1 cis' \tuplet 3/2 {8~ }
>
>
> }
>
> lower = \relative c { % remove \override
>   \clef bass
>   \key c \major
>   \time 4/4
>
> <<{f'1}-2\\{r4. e32-1 cis-2 a-4 f-1 d2-2}>>
>
> }
>
> \score {
>   \new PianoStaff <<
> \set PianoStaff.instrumentName = #"Piano  "
> \new Staff = "upper" \upper
> \new Staff = "lower" \lower
>   >>
>   *\layout { *
> *\context {*
> *\Staff*
> *\override Fingering.color = #red*
> *}*
> *  }*
>   \midi { }
> }
>
>
> On 7/18/22 09:36, Jim Cline wrote:
>
> Hi David, thanks, I have attached a 1-measure example that illustrates the
> problem.  The upper staff is showing the requested color for the
> fingering.  I can see now that it has to do with the <<{}\\{}>> construct.
> The override does not apply to objects within << >> apparently.  Any
> suggestions will be appreciated.  regards, Jim
>
>
>
> \version "2.20.0"
>
> upper = \relative c'' {
>   \override Fingering.color = #red
>   \clef treble
>   \key c \major
>   \time 4/4
>
> a-1 cis' \tuplet 3/2 {8~ }
>
>
> }
>
> lower = \relative c {
>   \override Fingering.color = #red
>   \clef bass
>   \key c \major
>   \time 4/4
>
> <<{f'1}-2\\{r4. e32-1 cis-2 a-4 f-1 d2-2}>>
>
> }
>
> \score {
>   \new PianoStaff <<
> \set PianoStaff.instrumentName = #"Piano  "
> \new Staff = "upper" \upper
> \new Staff = "lower" \lower
>   >>
>   \layout { }
>   \midi { }
> }
>
> --
> William Rehwinkel
> william@williamrehwinkel.nethttps://williamrehwinkel.net
>
>


Re: color change working in only upper staff

2022-07-18 Thread William Rehwinkel

Hey Jim,

To be honest, I'm not sure why the example you posted doesn't work, but 
I was able to find a workaround by using \contexts to apply the override 
to each staff, like so.


\version "2.20.0"

upper = \relative c'' { % remove \override
  \clef treble
  \key c \major
  \time 4/4

a-1 cis' \tuplet 3/2 {8~ }


}

lower = \relative c { % remove \override
  \clef bass
  \key c \major
  \time 4/4

<<{f'1}-2\\{r4. e32-1 cis-2 a-4 f-1 d2-2}>>

}

\score {
  \new PianoStaff <<
    \set PianoStaff.instrumentName = #"Piano  "
    \new Staff = "upper" \upper
    \new Staff = "lower" \lower
  >>
*\layout { **
**    \context {**
**    \Staff**
**    \override Fingering.color = #red**
**    }**
**  }*
  \midi { }
}


On 7/18/22 09:36, Jim Cline wrote:
Hi David, thanks, I have attached a 1-measure example that illustrates 
the problem.  The upper staff is showing the requested color for the 
fingering.  I can see now that it has to do with the <<{}\\{}>> 
construct.
The override does not apply to objects within << >> apparently.  Any 
suggestions will be appreciated.  regards, Jim




\version "2.20.0"

upper = \relative c'' {
  \override Fingering.color = #red
  \clef treble
  \key c \major
  \time 4/4

a-1 cis' \tuplet 3/2 {8~ }


}

lower = \relative c {
  \override Fingering.color = #red
  \clef bass
  \key c \major
  \time 4/4

<<{f'1}-2\\{r4. e32-1 cis-2 a-4 f-1 d2-2}>>

}

\score {
  \new PianoStaff <<
    \set PianoStaff.instrumentName = #"Piano  "
    \new Staff = "upper" \upper
    \new Staff = "lower" \lower
  >>
  \layout { }
  \midi { }
}


--
William Rehwinkel

will...@williamrehwinkel.net
https://williamrehwinkel.net


Re: color change working in only upper staff

2022-07-18 Thread Francesco Napoleoni
> lower = \relative c {
>\override Fingering.color = #red

This line could be changed to read

>\override Staff.Fingering.color = #red

which “speaks” to the right context.

You could also replace the two \override with something like this:

> \score {
>\new PianoStaff <<
>  \set PianoStaff.instrumentName = #"Piano  "
>  \override PianoStaff.Fingering.color = #red

which affects all the Staff contexts included.

Cheers
Francesco Napoleoni






Re: color change working in only upper staff

2022-07-18 Thread Jim Cline
Hi David, thanks, I have attached a 1-measure example that illustrates the 
problem.  The upper staff is showing the requested color for the 
fingering.  I can see now that it has to do with the <<{}\\{}>> construct.
The override does not apply to objects within << >> apparently.  Any 
suggestions will be appreciated.  regards, Jim




\version "2.20.0"

upper = \relative c'' {
  \override Fingering.color = #red
  \clef treble
  \key c \major
  \time 4/4

a-1 cis' \tuplet 3/2 {8~ }


}

lower = \relative c {
  \override Fingering.color = #red
  \clef bass
  \key c \major
  \time 4/4

<<{f'1}-2\\{r4. e32-1 cis-2 a-4 f-1 d2-2}>>

}

\score {
  \new PianoStaff <<
\set PianoStaff.instrumentName = #"Piano  "
\new Staff = "upper" \upper
\new Staff = "lower" \lower
  >>
  \layout { }
  \midi { }
}\version "2.20.0"

upper = \relative c'' {
  \override Fingering.color = #red
  \clef treble
  \key c \major
  \time 4/4

a-1 cis' \tuplet 3/2 {8~ }


}

lower = \relative c {
  \override Fingering.color = #red
  \clef bass
  \key c \major
  \time 4/4
  
<<{f'1}-2\\{r4. e32-1 cis-2 a-4 f-1 d2-2}>>

}

\score {
  \new PianoStaff <<
\set PianoStaff.instrumentName = #"Piano  "
\new Staff = "upper" \upper
\new Staff = "lower" \lower
  >>
  \layout { }
  \midi { }
}

Re: color change working in only upper staff

2022-07-18 Thread David Kastrup
Jim Cline  writes:

> I want to change the fingering color to red in my piano score.
> Using
>
> upper = \relative c'' {
>\override Fingering.color = #red
>
> for the upper staff works, but adding the same for the lower staff
>
> lower = \relative c {
>   \override Fingering.color = #red
>
> leaves the fingering in black in the lower staff.  The compiler gives
> no error message about it.  I tried commenting out the first override
> to see if that has some effect on the second one, but no.

You need to come up with an actually compiling full example showing the
problem.  The above is not useful and most certainly does not show
anything related to the actual problem.

-- 
David Kastrup



color change working in only upper staff

2022-07-18 Thread Jim Cline

I want to change the fingering color to red in my piano score.
Using

upper = \relative c'' {
   \override Fingering.color = #red

for the upper staff works, but adding the same for the lower staff

lower = \relative c {
  \override Fingering.color = #red

leaves the fingering in black in the lower staff.  The compiler gives no 
error message about it.  I tried commenting out the first override to see 
if that has some effect on the second one, but no.




Re: Installing Lilypond 2.23.10

2022-07-18 Thread Thomas Morley
Am Mo., 18. Juli 2022 um 11:16 Uhr schrieb Jean Abou Samra :
>
> Le 17/07/2022 à 17:03, David Sumbler a écrit :
> > At the moment I am testing it on a short file - in fact, your
> > "grow-in-up-direction" example from the Extending Lilypond document.
> >  Compiling it is taking over 80 seconds each time; after the first
> > time, I would expect a file like this to take only 3 or 4 seconds.
> >  This is very unsatisfactory.
>
>
> I can't explain this without further info -- was the directory where
> you installed LilyPond clean before?
>
> See below though.
>
>
> > No, I have never used a distro version of Lilypond.  Until this time,
> > I have always used a script downloaded from the Lilypond website.  I
> > install Lilypond globally (although I am the only user of this
> > computer), and the script chooses to put things where they now are.  I
> > always thought /usr/local/lilypond/usr/share/lilypond/ was an odd
> > place to put it, but that wasn't my choice.
> >
> > When I moved 2.23.10 from my home folder, I intentionally put it in
> > the same place as previous versions have been on my previous Ubuntu
> > installations, hoping this would increase the chances of it actually
> > working.  On this current OS version, I have not actually had any
> > previous versions of Lilypond, which is why I needed to install it
> > again now.
> >
> > In my .emacs file I have:
> >
> > ;;for Lilypond mode
> > (setq load-path (append (list (expand-file-name
> > "/usr/local/lilypond/usr/share/emacs/site-lisp")) load-path))
> > (autoload 'LilyPond-mode "lilypond-mode" "LilyPond Editing Mode" t)
> > (add-to-list 'auto-mode-alist '("\\.ly$" . LilyPond-mode))
> > (add-to-list 'auto-mode-alist '("\\.ily$" . LilyPond-mode))
> >
> > So yes, clearly Lilypond mode is working now because I have installed
> > Lilypond where the .sh script would have put it.  I can also see that
> > I can easily work round this by editing my .emacs file, if I decide to
> > put Lilypond somewhere else (e.g. my home folder).
> >
> > Is it the intention that the next "stable" version of Lilypond will be
> > packaged in this new way?  Will the shell script be done away with
> > there too?
> >
> > Even if not, what are the perceived advantages of this change for the
> > development versions, at least?
>
>
> Yes, all new versions of LilyPond will use this packaging. Getting
> rid of the .sh script was not the only change; it was actually a
> wholesale switch to a new compilation system, which is now 100×
> simpler and more reliable, and now creates static binaries. Before,
> a .sh installer was required, because once installed the binaries
> couldn't be moved around. Now that they can, it is just unnecessary.
>
> Not having a .sh installer has other advantages, too. It avoids
> conflicts with distro packages. It makes the installation process
> exactly the same across all OSes. It prevents people from shooting
> themselves in the foot by not realizing that several versions of
> LilyPond can be installed in parallel.
>
> I think you are overcomplicating things by trying to mimic
> the previous installation process with the new binaries.
> Changing /usr/local/ is normally done by package managers
> and dedicated tools, not by hand. If you don't know what
> you're doing there, don't touch it. (This kind of advice applies
> to any command using sudo, actually.)
>
> Instead, follow these simple steps. (I agree that _finding_ them
> is not simple, but again it will eventually be in the learning
> manual, with screenshots. That change has landed and will appear
> in the next release.)
>
> 1. Download the archive.
> 2. Unpack it.
> 3. Move the lilypond-2.23.10 directory inside it in your
> home folder.
> 4. In your .emacs, change the path in (expand-file-name ...)
> to "~/lilypond-2.23.10/share/emacs/site-lisp".
>
> And that's all.

I take the liberty to add my 2 cts.

It's a great advantage having dropped GUB (which produced the
installers) it was a maintaining nightmare.

Though, I miss the installer, too.
The installer put several scripts in my bin-folder pointing to entries
of /lilypond/bin (I'm on Linux, lilypond 2.23.9 for now):
abc2ly  convert-ly  etf2ly  lilypond  lilymidi  lilypond-book
lilypond-invoke-editor  lilysong  midi2ly  musicxml2ly
They worked out of the box.

With current archive I need to care myself, i.e. invoking above with
correct pathes or creating scripts myself.

>From a users point of view, it's more work.

So, I understand both sides 

Cheers,
  Harm



Re: error handling

2022-07-18 Thread Thomas Morley
Am Mo., 18. Juli 2022 um 11:02 Uhr schrieb Jean Abou Samra :
>
> Le 17/07/2022 à 23:33, Thomas Morley a écrit :
> > Sorry for the delayed reply!
> > I now tried to make some steps for scm-files/ly:load/autocompile.
> >
> > Though, as far as I can tell ly:load doesn't work with relative pathes.
>
>
> As said on the issue, I misremembered what ly:load does, sorry.
> Use add-to-load-path and primitive-load-path as in the example on
> the issue.
>
> I just tried using it and I didn't get conclusive results, but
> I don't even get locations on code within LilyPond itself right now,
> whereas usually I do. I'll probably find a silly mistake in my
> testing when I'm less tired.

I tried to follow two different methods today

###
(1) compile

In a /scm/file.scm:
(use-modules (system base compile))
(define whatever (lambda (arg) ))
(define whatever-procedure (compile 'whatever #:env (interaction-environment))

In an init.ly-file
#(begin
  (add-to-load-path ".")
  (primitive-load-path "scm/functions.scm"))

Actually this made all slower. Though, in the past I made other
experiments with `compile' making things faster.
While worth investigating, I stopped here, even before looking for
error handling.

###
(2) auto-compile

 My init.ly looks:

%%%
\version "2.23.9"

\include "zither-paper-defaults.ly"

%\include "zither-tab-markup-commands.ly"
#(begin
  ;; add current directory in load paths,
  ;; the default only contains Guile internal paths
  (add-to-load-path ".")
  (primitive-load-path "scm/markup-commands.scm"))

\include "zither-tab-titling.ly"

%\include "zither-tab-functions.ly"
#(begin
  (add-to-load-path ".")
  (primitive-load-path "scm/functions.scm"))

%\include "zither-scheme-engraver.ly"
#(begin
  (add-to-load-path ".")
  (primitive-load-path "scm/scheme-engraver.scm"))

\include "zither-tab-layout.ly"
%%%

My scm-folder:
$ ls scm/
functions.scm   markup-commands.scm   scheme-engraver.scm

If I now try to compile a file with
$ GUILE_AUTO_COMPILE=1 lilypond doc-snippets/zither-rests.ly
Further compilations without auto-compile are fast.

Forcing a known problem, which I was not able to localize before, now returns:
scm/functions.scm:375:8: In procedure set-rest-staff-position:
In procedure -: Wrong type argument in position 1: #f
That's pretty nice and a GREAT improvement.

Though, as soon as I do
$ cd doc-snippets
$ lilypond zither-rests.ly

Pathes are wrong again:
../zither-tab-init.ly:6:2: error: GUILE signaled an error for the
expression beginning here
#
 (begin
Unable to find file "scm/markup-commands.scm" in load path

Adding (add-to-load-path "..") cures it. Though, likely it will error
again, if I move to a different, not covered folder, to compile
something there.
I could provide the absolute path to primitive-load-path (I expect it
will work for me, not tested, though), and likey I'll do so for now.
Alas, it's not unlikely noone else can use this code, meant as a
public extension to LilyPond, without adjusting those pathes.

I'll probably stay with that setup for now, and change all back to
ly-files once current development cycle is finished.

>
> Meanwhile, another option is not to use version 2.23.10 (which
> is advertised as an "unstable" version after all). If you
> don't want to go back to 2.22, you could use 2.23.6 from
> lilypond.org, which is the last released version to use Guile 1,
> and not all that old.

Yeah, last resort ...

Thanks,
  Harm



Re: Code pointer from end-BarLine to previous NoteHead.?

2022-07-18 Thread David Kastrup
Jean Abou Samra  writes:

> Le 18/07/2022 à 00:59, David Kastrup a écrit :
>> Harm is not a C programmer either.  Scheme is his only language and he
>> learnt it because of LilyPond.  So he has no exposure to the low-level
>> nature of C++, nor to the basics of imperative programming languages
>> that are sort of a required firm footing before you dive into the
>> syntactic shitshow that C++ is.
>>
>> I certainly hope that he isn't as miffed at your dismissive attitude as
>> I am since he is one of the most important contributors coming from the
>> user side of LilyPond.
>
>
> I propose that we continue this part of the discussion
> off-list (but it may take me some time to reply).

My whole point was to stop it, not continue it.

-- 
David Kastrup



Re: Installing Lilypond 2.23.10

2022-07-18 Thread Jean Abou Samra

Le 17/07/2022 à 17:03, David Sumbler a écrit :
At the moment I am testing it on a short file - in fact, your 
"grow-in-up-direction" example from the Extending Lilypond document. 
 Compiling it is taking over 80 seconds each time; after the first 
time, I would expect a file like this to take only 3 or 4 seconds. 
 This is very unsatisfactory.



I can't explain this without further info -- was the directory where
you installed LilyPond clean before?

See below though.


No, I have never used a distro version of Lilypond.  Until this time, 
I have always used a script downloaded from the Lilypond website.  I 
install Lilypond globally (although I am the only user of this 
computer), and the script chooses to put things where they now are.  I 
always thought /usr/local/lilypond/usr/share/lilypond/ was an odd 
place to put it, but that wasn't my choice.


When I moved 2.23.10 from my home folder, I intentionally put it in 
the same place as previous versions have been on my previous Ubuntu 
installations, hoping this would increase the chances of it actually 
working.  On this current OS version, I have not actually had any 
previous versions of Lilypond, which is why I needed to install it 
again now.


In my .emacs file I have:

;;for Lilypond mode
(setq load-path (append (list (expand-file-name 
"/usr/local/lilypond/usr/share/emacs/site-lisp")) load-path))

(autoload 'LilyPond-mode "lilypond-mode" "LilyPond Editing Mode" t)
(add-to-list 'auto-mode-alist '("\\.ly$" . LilyPond-mode))
(add-to-list 'auto-mode-alist '("\\.ily$" . LilyPond-mode))

So yes, clearly Lilypond mode is working now because I have installed 
Lilypond where the .sh script would have put it.  I can also see that 
I can easily work round this by editing my .emacs file, if I decide to 
put Lilypond somewhere else (e.g. my home folder).


Is it the intention that the next "stable" version of Lilypond will be 
packaged in this new way?  Will the shell script be done away with 
there too?


Even if not, what are the perceived advantages of this change for the 
development versions, at least?



Yes, all new versions of LilyPond will use this packaging. Getting
rid of the .sh script was not the only change; it was actually a
wholesale switch to a new compilation system, which is now 100×
simpler and more reliable, and now creates static binaries. Before,
a .sh installer was required, because once installed the binaries
couldn't be moved around. Now that they can, it is just unnecessary.

Not having a .sh installer has other advantages, too. It avoids
conflicts with distro packages. It makes the installation process
exactly the same across all OSes. It prevents people from shooting
themselves in the foot by not realizing that several versions of
LilyPond can be installed in parallel.

I think you are overcomplicating things by trying to mimic
the previous installation process with the new binaries.
Changing /usr/local/ is normally done by package managers
and dedicated tools, not by hand. If you don't know what
you're doing there, don't touch it. (This kind of advice applies
to any command using sudo, actually.)

Instead, follow these simple steps. (I agree that _finding_ them
is not simple, but again it will eventually be in the learning
manual, with screenshots. That change has landed and will appear
in the next release.)

1. Download the archive.
2. Unpack it.
3. Move the lilypond-2.23.10 directory inside it in your
   home folder.
4. In your .emacs, change the path in (expand-file-name ...)
   to "~/lilypond-2.23.10/share/emacs/site-lisp".

And that's all.

Best,
Jean




Re: error handling

2022-07-18 Thread Jean Abou Samra

Le 17/07/2022 à 23:33, Thomas Morley a écrit :

Sorry for the delayed reply!
I now tried to make some steps for scm-files/ly:load/autocompile.

Though, as far as I can tell ly:load doesn't work with relative pathes.



As said on the issue, I misremembered what ly:load does, sorry.
Use add-to-load-path and primitive-load-path as in the example on
the issue.

I just tried using it and I didn't get conclusive results, but
I don't even get locations on code within LilyPond itself right now,
whereas usually I do. I'll probably find a silly mistake in my
testing when I'm less tired.

Meanwhile, another option is not to use version 2.23.10 (which
is advertised as an "unstable" version after all). If you
don't want to go back to 2.22, you could use 2.23.6 from
lilypond.org, which is the last released version to use Guile 1,
and not all that old.

Best,
Jean




Re: Code pointer from end-BarLine to previous NoteHead.?

2022-07-18 Thread Jean Abou Samra

Le 18/07/2022 à 00:59, David Kastrup a écrit :

Harm is not a C programmer either.  Scheme is his only language and he
learnt it because of LilyPond.  So he has no exposure to the low-level
nature of C++, nor to the basics of imperative programming languages
that are sort of a required firm footing before you dive into the
syntactic shitshow that C++ is.

I certainly hope that he isn't as miffed at your dismissive attitude as
I am since he is one of the most important contributors coming from the
user side of LilyPond.



I propose that we continue this part of the discussion
off-list (but it may take me some time to reply).





Re: Piping contents of SVG directly to stdout

2022-07-18 Thread Henning Hraban Ramm

Am 18.07.22 um 06:39 schrieb William:
Felix, I’m curious what you mean by cropping the file. Sounds to me like 
you are trying to just write a small snippet of music, maybe a few 
measures, and not have the output flooded by whitespace all around the 
size of an A4 paper? This is also similar to what I was using lilypond 
for and there are ways to do this without any external apps.


I never used the SVG backend, but maybe the lilypond-book header works 
with it, too?
It helps to create small snippets, I used the following settings in my 
LilyPond setup for ConTeXt:


% --- start of setup for single-line output files ---
#(define default-toplevel-book-handler
  print-book-with-defaults-as-systems )

#(define toplevel-book-handler
  (lambda ( . rest)
  (set! output-empty-score-list #f)
  (apply print-book-with-defaults rest)))

#(define toplevel-music-handler
  (lambda ( . rest)
   (apply collect-music-for-book rest)))

#(define toplevel-score-handler
  (lambda ( . rest)
   (apply collect-scores-for-book rest)))

#(define toplevel-text-handler
  (lambda ( . rest)
   (apply collect-scores-for-book rest)))

#(set! output-empty-score-list #t)

% --- stop single-line setup ---


Hraban




Re: Piping contents of SVG directly to stdout

2022-07-18 Thread Andrew Bernard
File IO _expensive_ in 2022? What do you mean exactly? What sort of 
computer and disks are you referring to? Surely lilypond processing 
completely dominates any IO it does?


Andrew


On 16/07/2022 5:15 am, DoubleFelix wrote:

Hello,

I'm using lilypond to programmatically generate sheet music. I already 
have a system in place to crop the SVGs, but now I need to load them 
in my software. I could use the default behavior of letting lilypond 
write to some file, and then reading it, but file I/O tends to be 
pretty expensive, especially when you're doing it in bulk like I am, 
so I'd like to avoid that.