Re: A speed test on Apple's M1 processor

2022-09-11 Thread Jonas Hahnfeld via LilyPond user discussion
On Sun, 2022-09-11 at 11:52 +0200, Jacques Menu wrote:
> Native lilypond:
> 
> jacquesmenu@macmini:/Volumes/JMI_Volume/JMI_Developpement/lilypond/re
> lease/binaries/lilypond/install/bin > time ./lilypond
> Fischer_Suite_Sol_M_viola_II_2.23.12.ly

Based on the path, did you build with the scripts in release/binaries
of the repository or did you build from scratch yourself? If the
latter, did you compile the bytecode (make bytecode)?

> GNU LilyPond 2.23.12 (running Guile 2.2)
> Processing `Fischer_Suite_Sol_M_viola_II_2.23.12.ly'
> … … …
> Preprocessing graphical objects...
> Finding the ideal number of pages...
> Fitting music on 54 or 55 pages...
> Drawing systems...
> Converting to `Fischer_Suite_Sol_M_viola_II_2.23.12.pdf'...
> fatal error: failed files: "Fischer_Suite_Sol_M_viola_II_2.23.12.ly"
> ./lilypond Fischer_Suite_Sol_M_viola_II_2.23.12.ly  7.52s user 0.75s
> system 98% cpu 8.387 total

You have a "fatal error" when processing the converted file. Not sure
where this happens, but maybe check that you are really compiling what
you think you are...

Jonas


signature.asc
Description: This is a digitally signed message part


Re: Hairpins can continue around line breaks but not page breaks?

2022-09-11 Thread Kenneth Wolcott
Hi Andrew;

  Thanks, it looks like that is yet another thing that I have to put
into the "can't grok now, study it and try it again later" pile of
Lilypond features. **SIGH**

Ken

On Sun, Sep 11, 2022 at 8:20 PM Andrew Bernard
 wrote:
>
> It's LSR 804. I do this all the time.
>
> [I confess I have not checked this moment re page breaking.]
>
>
> Andrew
>
>
>



Re: Hairpins can continue around line breaks but not page breaks?

2022-09-11 Thread Kenneth Wolcott
Hi Kieren;

  Yeah, I didn't state my question as precisely as I meant to.

  This arranger uses the mixture of styles **in the same action**
(what is a better way to state this?)

  I think it is fine to use text the first time, then use a hairpin
for the next time, etc; but these are distinct actions.

  Anyway, I was able to get the hairpin to work if I disabled the
forced line break and the forced page break.

  I tried fiddling around with "\override Hairpin.to-barline = ##f"
from "Controlling spanner visibility after a line break" in the
Snippets Reference, but apparently I don't know how to use that
properly, as it looks like a NO-OP :-)

Thanks,
Ken


On Sun, Sep 11, 2022 at 7:37 PM Kieren MacMillan
 wrote:
>
> Hi Ken,
>
> > BTW, this arranger uses a mixture of hairpins and "cresc."/"dim." which 
> > seems really silly to me.
> > Why not use only hairpins or only cresc+dim?
>
> There are lots of good reasons to use both in a single score. That being 
> said, a quick glance at the score you attached suggests the good reasons 
> aren't the ones being used here…
>
> Cheers,
> Kieren.



Re: Hairpins can continue around line breaks but not page breaks?

2022-09-11 Thread Andrew Bernard

It's LSR 804. I do this all the time.

[I confess I have not checked this moment re page breaking.]


Andrew





Re: Hairpins can continue around line breaks but not page breaks?

2022-09-11 Thread Kieren MacMillan
Hi Ken,

> BTW, this arranger uses a mixture of hairpins and "cresc."/"dim." which seems 
> really silly to me.
> Why not use only hairpins or only cresc+dim?

There are lots of good reasons to use both in a single score. That being said, 
a quick glance at the score you attached suggests the good reasons aren't the 
ones being used here…

Cheers,
Kieren.



Re: Hairpins can continue around line breaks but not page breaks?

2022-09-11 Thread Kenneth Wolcott
Well, the hairpin doesn't continue across the forced line break either; it
silently vanishes.

BTW, this arranger uses a mixture of hairpins and "cresc."/"dim." which
seems really silly to me.

Why not use only hairpins or only cresc+dim?

Thanks,
Ken

On Sun, Sep 11, 2022 at 7:25 PM Kenneth Wolcott 
wrote:

> HI;
>
>   I have a partial crescendo hairpin followed by a forced page break but
> the hairpin silently vanishes on the following page.  Is this a known bug
> or am I doing something stupid?  At this point I can go with the forced
> line breaks of the original arranger resulting in 6 cramped systems on one
> page followed by the last (and only) system on the following page and still
> have the hairpin wrap around the line break.
>
>   If what I am stating is not obvious, I can provide screenshots.
>
> Thanks,
> Ken Wolcott
>


Chopin_Prelude_in_E_minor_Op28_Nr4_arranged_for_Piano.pdf
Description: Adobe PDF document


Hairpins can continue around line breaks but not page breaks?

2022-09-11 Thread Kenneth Wolcott
HI;

  I have a partial crescendo hairpin followed by a forced page break but
the hairpin silently vanishes on the following page.  Is this a known bug
or am I doing something stupid?  At this point I can go with the forced
line breaks of the original arranger resulting in 6 cramped systems on one
page followed by the last (and only) system on the following page and still
have the hairpin wrap around the line break.

  If what I am stating is not obvious, I can provide screenshots.

Thanks,
Ken Wolcott


Re: Context question

2022-09-11 Thread Jean Abou Samra

Le 11/09/2022 à 23:01, John Schlomann a écrit :


Can someone please explain why the following won’t work. I want get 
the current moment at the end of the music expression. Is this not a 
valid thing to do? Or perhaps I don’t know how to specify the context. 
This code gives an unbound variable error.


\version "2.22.2"

\score {
  \relative c'' {
    \new Staff {
  a b c d
  #(display (ly:context-current-moment Staff))
    }
  }
}





This code tries to mix two passes of LilyPond's processing that
are separate. First, LilyPond reads the input code, and creates
music objects from it, basically those that you store in variables
when you do

violin = \relative c' { ... }
% \violin is a music expression

Now, suppose that you could do

violinPartI =
\relative c' {
  ...
}

violinPartII =
\relative c' {
  ...
  #(display (ly:context-current-moment Staff))
  ...
}

%% What has been printed at this point?

\score {
  {
    \violinPartI
    \violinPartII
  }
}

How could this work? The current moment of the context at the point
you ask for it won't be determined until the whole score, including
the duration of violinPartI, is known. Yet you are asking it as soon
as violinPartII is read.

A music expression is just, well, an expression. At the time it is
read, nothing special happens. It's just a data structure. There are
no variables in scope ("Staff" is not defined), no execution process.
Scheme code used within a music expression is executed at the moment
the music is read. This just serves to embed a piece of Scheme-generated
music into it, like in

\version "2.22.2"

\score {
  {
    \new Staff {
  #(make-sequential-music
    (map (lambda (i)
   (make-music 'NoteEvent
   'duration #{ 4 #}
   'pitch (ly:make-pitch 0 i 0)))
 (iota 20)))
    }
  }
}

What I've done here is putting some Scheme expression that generates
a piece of music that you could have written as { c'4 d'4 e'4 ... }.
This is just creating a piece of music, without any ambient context
from the surrounding music, since that music has not been determined
yet.

Then, _after_ all the music expressions have been read and assembled,
LilyPond will start its "iteration" (also called "translation") process,
and only then contexts and timing start to come into play.

The way to achieve what you are after is to use the \applyContext hook,
which embeds a procedure into the music expression that will be executed
at iteration time. It's documented here:

https://lilypond.org/doc/v2.22/Documentation/extending/context-evaluation

Example:

\version "2.22.2"

\score {
  \relative c'' {
    \new Staff {
  a b c d
  \context Staff
    \applyContext
  #(lambda (context)
 (display (ly:context-current-moment context)))
    }
  }
}


Maybe this will help you understand the different stages of LilyPond's
processing:

https://extending-lilypond.readthedocs.io/en/latest/intro.html#overview-of-lilypond-s-inner-workings-and-how-you-might-hook-in-them

Best,
Jean




Re: Context question

2022-09-11 Thread David Kastrup
"John Schlomann"  writes:

> Can someone please explain why the following won't work. I want get the
> current moment at the end of the music expression. Is this not a valid thing
> to do? Or perhaps I don't know how to specify the context. This code gives
> an unbound variable error.
>
>  
>
> \version "2.22.2"
>
>  
>
> \score {
>
>   \relative c'' {
>
> \new Staff {
>
>   a b c d
>
>   #(display (ly:context-current-moment Staff))

Try \applyContext #(lambda (c) (display (ly:context-current-moment c)))

here.  #(display ...) is called when it is encountered.  \applyContext,
in contrast, creates a music expression that is called when the music is
interpreted, "iterated".

>
> }
>
>   }
>
> }


-- 
David Kastrup



Re: Context question

2022-09-11 Thread Lukas-Fabian Moser

Hi Johan,

Am 11.09.22 um 23:01 schrieb John Schlomann:


Can someone please explain why the following won’t work. I want get 
the current moment at the end of the music expression. Is this not a 
valid thing to do? Or perhaps I don’t know how to specify the context. 
This code gives an unbound variable error.


\version "2.22.2"

\score {

  \relative c'' {

    \new Staff {

  a b c d

  #(display (ly:context-current-moment Staff))

    }

  }

}



Try:

\version "2.22.2"

\score {
  \relative c'' {
    \new Staff {
  a b c d
  \applyContext #(lambda (ctx)
   (display (ly:context-current-moment ctx)))
    }
  }
}

There are better people than I on this list to explain _why_ it has to 
be done this way - I'm sure I'd get the explanation not 100% correct. 
Basically, if my mental image is somewhat correct, it has to do with the 
fact that at the point of time where LilyPond interprets your music, 
there is no context (yet) and no current moment. So we have to provide a 
_function_ that is evaluated later, depending on the (then current) 
context. That context will usually be a Voice context, as can be seen by 
adding a


(display (ly:context-name ctx))

command in your function. If you want to force your lambda function to 
be evaluated in another context (e.g. Staff), you can write \context 
Staff \applyContext ... - but this is rarely needed, since (again: in my 
understanding) contexts form a hierarchy, and you can access 
higher-level context properties also from your Voice context.


And now I'll get ready for a bunch of corrections from Jean, David K., 
Valentin and others :-).


Lukas


Context question

2022-09-11 Thread John Schlomann
Can someone please explain why the following won't work. I want get the
current moment at the end of the music expression. Is this not a valid thing
to do? Or perhaps I don't know how to specify the context. This code gives
an unbound variable error.

 

\version "2.22.2"

 

\score {

  \relative c'' {

\new Staff {

  a b c d

  #(display (ly:context-current-moment Staff))

}

  }

}

 

Thank you for any help.

John

 



Re: A speed test on Apple's M1 processor

2022-09-11 Thread Jean Abou Samra

Hi Jacques,

Le 11/09/2022 à 11:52, Jacques Menu a écrit :

Hello folks,

I ran this test with a 7.4Mb, 55 page score, to compare the binaries 
provided by lilypond.org  and the natives ones I 
(finally) built locally on my 8 Gb RAM Mac Mini.
The necessary libraries have been installed using both MacPorts and 
Homebrew, since not all of them are supplied by a single source.



I find this surprising, since both MacPorts and Homebrew provide a 
LilyPond package. What are the dependencies missing on each side? Have 
you tried looking at their respective build definitions? The one for 
Homebrew is here:


https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/lilypond.rb

and for MacPorts it's here:

https://github.com/macports/macports-ports/blob/master/textproc/lilypond/Portfile

By the way, it's a very good idea (well, it's essential) to build 
LilyPond if you want to contribute to it, but for anyone just looking 
for native Apple Silicon binaries of LilyPond, just install from 
MacPorts or Homebrew. MacPorts is recommended for the time being because 
Homebrew uses version 2.22 with Guile 2. Since we did not support 
byte-compilation of Scheme code at that time, the Homebrew version will 
be slower (and in particular have bad startup time).


Best,
Jean




A speed test on Apple's M1 processor

2022-09-11 Thread Jacques Menu
Hello folks,

I ran this test with a 7.4Mb, 55 page score, to compare the binaries provided 
by lilypond.org and the natives ones I (finally) built locally on my 8 Gb RAM 
Mac Mini. 
The necessary libraries have been installed using both MacPorts and Homebrew, 
since not all of them are supplied by a single source.

Both versions are 2.23.12.
The speed increase is roughly 20 to 25%, thanks to the avoidance of Intel CPU 
instructions emulation.

I will send the test file privately to anyone interested with pleasure, and you 
can send me larger files for more tests.

A nice day!

JM

--

First convert the LilyPond file to version 2.23.12.

Native convert-ly:

jacquesmenu@macmini:/Volumes/JMI_Volume/JMI_Developpement/lilypond/release/binaries/lilypond/install/bin
 > time ./convert-ly Fischer_Suite_Sol_M_viola_II.ly > 
Fischer_Suite_Sol_M_viola_II_2.23.12.ly
convert-ly (GNU LilyPond) 2.23.12

convert-ly: Processing `Fischer_Suite_Sol_M_viola_II.ly'... 
Applying conversion: 2.20.0, 2.21.0, 2.21.2, 2.23.1, 2.23.2, 2.23.3, 2.23.4, 
2.23.5, 2.23.6, 2.23.7, 2.23.8, 2.23.9, 2.23.10, 2.23.11, 2.23.12


./convert-ly Fischer_Suite_Sol_M_viola_II.ly >   5.80s user 0.04s system 99% 
cpu 5.871 total
jacquesmenu@macmini:/Volumes/JMI_Volume/JMI_Developpement/lilypond/release/binaries/lilypond/install/bin
 > time ./convert-ly Fischer_Suite_Sol_M_viola_II.ly > 
Fischer_Suite_Sol_M_viola_II_2.23.12.ly
convert-ly (GNU LilyPond) 2.23.12

convert-ly: Processing `Fischer_Suite_Sol_M_viola_II.ly'... 
Applying conversion: 2.20.0, 2.21.0, 2.21.2, 2.23.1, 2.23.2, 2.23.3, 2.23.4, 
2.23.5, 2.23.6, 2.23.7, 2.23.8, 2.23.9, 2.23.10, 2.23.11, 2.23.12


./convert-ly Fischer_Suite_Sol_M_viola_II.ly >   5.72s user 0.04s system 99% 
cpu 5.801 total
jacquesmenu@macmini:/Volumes/JMI_Volume/JMI_Developpement/lilypond/release/binaries/lilypond/install/bin
 > time ./convert-ly Fischer_Suite_Sol_M_viola_II.ly > 
Fischer_Suite_Sol_M_viola_II_2.23.12.ly
convert-ly (GNU LilyPond) 2.23.12

convert-ly: Processing `Fischer_Suite_Sol_M_viola_II.ly'... 
Applying conversion: 2.20.0, 2.21.0, 2.21.2, 2.23.1, 2.23.2, 2.23.3, 2.23.4, 
2.23.5, 2.23.6, 2.23.7, 2.23.8, 2.23.9, 2.23.10, 2.23.11, 2.23.12


./convert-ly Fischer_Suite_Sol_M_viola_II.ly >   5.71s user 0.03s system 99% 
cpu 5.748 total


LilyPond-supplied convert-ly. Here, there are variations for some reason:

jacquesmenu@macmini:/Applications/JMI_Applications/LilyPond/lilypond-2.23.12/bin
 > time ./convert-ly Fischer_Suite_Sol_M_viola_II.ly > 
Fischer_Suite_Sol_M_viola_II_2.23.12.ly

convert-ly (GNU LilyPond) 2.23.12

convert-ly: Processing `Fischer_Suite_Sol_M_viola_II.ly'... 
Applying conversion: 2.20.0, 2.21.0, 2.21.2, 2.23.1, 2.23.2, 2.23.3, 2.23.4, 
2.23.5, 2.23.6, 2.23.7, 2.23.8, 2.23.9, 2.23.10, 2.23.11, 2.23.12


./convert-ly Fischer_Suite_Sol_M_viola_II.ly >   7.18s user 0.03s system 99% 
cpu 7.225 total
jacquesmenu@macmini:/Applications/JMI_Applications/LilyPond/lilypond-2.23.12/bin
 > time ./convert-ly Fischer_Suite_Sol_M_viola_II.ly > 
Fischer_Suite_Sol_M_viola_II_2.23.12.ly

convert-ly (GNU LilyPond) 2.23.12

convert-ly: Processing `Fischer_Suite_Sol_M_viola_II.ly'... 
Applying conversion: 2.20.0, 2.21.0, 2.21.2, 2.23.1, 2.23.2, 2.23.3, 2.23.4, 
2.23.5, 2.23.6, 2.23.7, 2.23.8, 2.23.9, 2.23.10, 2.23.11, 2.23.12


./convert-ly Fischer_Suite_Sol_M_viola_II.ly >   7.25s user 0.04s system 99% 
cpu 7.323 total
jacquesmenu@macmini:/Applications/JMI_Applications/LilyPond/lilypond-2.23.12/bin
 > time ./convert-ly Fischer_Suite_Sol_M_viola_II.ly > 
Fischer_Suite_Sol_M_viola_II_2.23.12.ly

convert-ly (GNU LilyPond) 2.23.12

convert-ly: Processing `Fischer_Suite_Sol_M_viola_II.ly'... 
Applying conversion: 2.20.0, 2.21.0, 2.21.2, 2.23.1, 2.23.2, 2.23.3, 2.23.4, 
2.23.5, 2.23.6, 2.23.7, 2.23.8, 2.23.9, 2.23.10, 2.23.11, 2.23.12


./convert-ly Fischer_Suite_Sol_M_viola_II.ly >   15.13s user 0.05s system 99% 
cpu 15.203 total


—

Then apply lilypond to the converted file. ‘… ... ...’ is used for the sake of 
compactness.

Native lilypond:

jacquesmenu@macmini:/Volumes/JMI_Volume/JMI_Developpement/lilypond/release/binaries/lilypond/install/bin
 > time ./lilypond Fischer_Suite_Sol_M_viola_II_2.23.12.ly
GNU LilyPond 2.23.12 (running Guile 2.2)
Processing `Fischer_Suite_Sol_M_viola_II_2.23.12.ly'
… … …
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 54 or 55 pages...
Drawing systems...
Converting to `Fischer_Suite_Sol_M_viola_II_2.23.12.pdf'...
fatal error: failed files: "Fischer_Suite_Sol_M_viola_II_2.23.12.ly"
./lilypond Fischer_Suite_Sol_M_viola_II_2.23.12.ly  7.52s user 0.75s system 98% 
cpu 8.387 total


jacquesmenu@macmini:/Volumes/JMI_Volume/JMI_Developpement/lilypond/release/binaries/lilypond/install/bin
 > time ./lilypond Fischer_Suite_Sol_M_viola_II_2.23.12.ly
GNU LilyPond 2.23.12 (running Guile 2.2)
Processing `Fischer_Suite_Sol_M_viola_II_2.23.12.ly'
… … …
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 54 or 55 page