Re: Output PDF to stdout

2024-01-04 Thread David Wright
On Thu 04 Jan 2024 at 23:34:28 (+0100), Volodymyr Prokopyuk wrote:
> 
> I know that lilypond can receive a source.ly file from the stdin by
> using lilypond
> -. Is it possible for lilypond to output PDF to the stdout?
> 
> My motivation behind using lilypond in a pipeline is to speed up PDF
> generation by avoiding storing intermediary files on disk. The pipeline I'd
> like to implement is
> cat source.ly | lintLy | lilypond - | optimizePDF > score.pdf
> Currently lilypond engraves PDF on disk, so a PDF optimizer has to read,
> optimize, and substitute PDF on disk.

You could create a RAM disk to hold your intermediate files,
something along the lines of:

   Ramdir="/dev/shm/${FUNCNAME[0]}$(printf '%(%s)T' -1)"
 $ mkdir -p "$Ramdir"

The first line (which I run in a bash function, for a quite different
purpose) creates a pseudounique but recognizable name, and the second
line creates the directory.

Cheers,
David.



Re: Slurs within chords, and dotted notes

2024-01-04 Thread Joel C. Salomon

I should have been clearer.  The score I’m trying to emulate has slurs—

|4.  |

—and it’s the vertical movement of the slurs I’m trying to avoid.

The fact that ties will overlap the note dots was a curiosity I found in 
trying to boil that down to a minimal working example.


—Joel

On 1/4/2024 9:28 PM, Mark Stephen Mrotek wrote:


Joel:

Is this better?

\fixed c' {

2

 |

2.

4 |

2 q |

2. q4 |

}

Mark

*From:* lilypond-user-bounces+carsonmark=ca.rr@gnu.org 
 *On Behalf Of 
*Joel C. Salomon

*Sent:* Thursday, January 4, 2024 6:11 PM
*To:* LilyPond Users 
*Subject:* Slurs within chords, and dotted notes

Somewhat surprising result, tested on 2.24 & 2.25.11:

|```|
|\version "2.24"|

|\fixed c' {|
|  2|
|   ||

|  2.|
|  4 ||

|  2 q ||

|  2. q4 ||
|}|
|```|

In the second instance, the tie attaches to the bottom of the initial 
chord, presumably to avoid colliding with the dot.  (Interestingly, 
as in examples 3 & 4, a tie will happily display overlapping the dot.)


Obvious searches (like [lilypond chord slur dotted note] 
) do 
not turn up mention of this, or of any tweak to avoid this.  Any hints?


—Joel C. Salomon



RE: Slurs within chords, and dotted notes

2024-01-04 Thread Mark Stephen Mrotek
Joel:

 

Is this better?

 

\fixed c' {

  2

   |

 

  2.

  4 |

 

  2 q |

 

  2. q4 |

}

 

Mark

 

From: lilypond-user-bounces+carsonmark=ca.rr@gnu.org 
 On Behalf Of Joel C. 
Salomon
Sent: Thursday, January 4, 2024 6:11 PM
To: LilyPond Users 
Subject: Slurs within chords, and dotted notes

 

Somewhat surprising result, tested on 2.24 & 2.25.11:

```
\version "2.24"

\fixed c' {
  2
   |

  2.
  4 |

  2 q |

  2. q4 |
}
``` 

In the second instance, the tie attaches to the bottom of the initial chord, 
presumably to avoid colliding with the dot.  (Interestingly, as in examples 3 & 
4, a tie will happily display overlapping the dot.)

Obvious searches (like [lilypond chord slur dotted note] 
 ) do not turn 
up mention of this, or of any tweak to avoid this.  Any hints?

—Joel C. Salomon



Slurs within chords, and dotted notes

2024-01-04 Thread Joel C. Salomon

Somewhat surprising result, tested on 2.24 & 2.25.11:

|```
\version "2.24"

\fixed c' {
  2
   |

  2.
  4 |

  2 q |

  2. q4 |
}
```|

In the second instance, the tie attaches to the bottom of the initial 
chord, presumably to avoid colliding with the dot. (Interestingly, as in 
examples 3 & 4, a tie will happily display overlapping the dot.)


Obvious searches (like [lilypond chord slur dotted note] 
) do 
not turn up mention of this, or of any tweak to avoid this.  Any hints?


—Joel C. Salomon


Thank you!

2024-01-04 Thread Joel C. Salomon
I’ve been asking questions on this list for a decade now, and with your 
help I’ve finally managed to complete my spare-time project (the Peter 
Pan score I’ve occasionally mentioned) and publish it.  Thank you all!


(Thanks especially to everyone who made `\repeat segno` work.  With some 
scores in the book, the old kluges and manual repeats for MIDI 
generation were so daunting that I abandoned the project for a few years.)


—Joel C. Salomon




Re: Output PDF to stdout

2024-01-04 Thread mskala
On Fri, 5 Jan 2024, Dr. Arne Babenhauserheide wrote:

> > intermediate "files" will be written to and read from the buffer cache at
> > RAM speed and only later go to the disk in the background.
>
> That depends on the file system and its synchronization model. I once
> sped up a script to control a cluster by more than factor 10 by avoiding
> intermediate writes to the shared network filesystem of the cluster
> nodes. That made the difference between 15 minutes and 30 seconds
> runtime.

I'm sure you're already aware of the important differences between that
and the situation described in this thread.

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before tribes.
https://ansuz.sooke.bc.ca/



Re: Output PDF to stdout

2024-01-04 Thread Dr. Arne Babenhauserheide

msk...@ansuz.sooke.bc.ca writes:

> On Thu, 4 Jan 2024, Volodymyr Prokopyuk wrote:
>
>> My motivation behind using lilypond in a pipeline is to speed up PDF
>> generation by avoiding storing intermediary files on disk. The pipeline I'd
>
> Is that issue real?  In Linux and most other operating systems,
> intermediate "files" will be written to and read from the buffer cache at
> RAM speed and only later go to the disk in the background.

That depends on the file system and its synchronization model. I once
sped up a script to control a cluster by more than factor 10 by avoiding
intermediate writes to the shared network filesystem of the cluster
nodes. That made the difference between 15 minutes and 30 seconds
runtime.

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de


signature.asc
Description: PGP signature


Re: Output PDF to stdout

2024-01-04 Thread Jean Abou Samra
This doesn't exist, sorry. It wouldn't be *that* straightforward to implement,
because there are multiple code paths for output (GhostScript via API, 
GhostScript
via subprocess, SVG backend and Cairo). I'm not even sure that direct PDF output
in GhostScript's PS → PDF conversion is not going through an intermediate file
under the hood. Either way, I really doubt this would make a significant speed
difference.



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


Re: Output PDF to stdout

2024-01-04 Thread mskala
On Thu, 4 Jan 2024, Volodymyr Prokopyuk wrote:

> My motivation behind using lilypond in a pipeline is to speed up PDF
> generation by avoiding storing intermediary files on disk. The pipeline I'd

Is that issue real?  In Linux and most other operating systems,
intermediate "files" will be written to and read from the buffer cache at
RAM speed and only later go to the disk in the background.  The subsequent
process that uses the file won't be waiting for the disk I/O to complete.
Even if a pipe might theoretically be even faster than the buffer cache,
the intermediate unoptimized PDF is unlikely to be the bottleneck step in
generation of an optimized PDF.

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before tribes.
https://ansuz.sooke.bc.ca/



Output PDF to stdout

2024-01-04 Thread Volodymyr Prokopyuk
Hi,

I know that lilypond can receive a source.ly file from the stdin by
using lilypond
-. Is it possible for lilypond to output PDF to the stdout?

My motivation behind using lilypond in a pipeline is to speed up PDF
generation by avoiding storing intermediary files on disk. The pipeline I'd
like to implement is
cat source.ly | lintLy | lilypond - | optimizePDF > score.pdf
Currently lilypond engraves PDF on disk, so a PDF optimizer has to read,
optimize, and substitute PDF on disk.

Thank you,
Vlad


Re: build a specific stable lillypond version with git

2024-01-04 Thread David Kastrup
CX  writes:

> Is it possible to build a specific stable lillypond version with sources
> retrieved by git clone instead of a source tarball download?
> If it is possible how can you do this (because I can not find the
> documentation to do it)?

The README in the repository references


Have you checked it?

In particular, setting it up from a clone appears to be described in


-- 
David Kastrup



build a specific stable lillypond version with git

2024-01-04 Thread CX
Is it possible to build a specific stable lillypond version with sources
retrieved by git clone instead of a source tarball download?
If it is possible how can you do this (because I can not find the
documentation to do it)?

Please help.
Best Regards Claude


Setting paper indents using Scheme code

2024-01-04 Thread Nate Whetsell
Hi,

I have a custom engraver 
(https://github.com/nwhetsell/lilypond-instrument-name-measuring-engraver) that 
helps align instrument names like what’s shown on p. 509 of Elaine Gould’s 
Behind Bars. In a nutshell, this engraver works by measuring the x extent of 
system start text stencils, remembering the largest widths, and then reporting 
those widths (using ly:message) so they can be used as indents in a paper block.

It would be better, though, if the engraver set paper indents directly using (I 
believe) ly:output-def-set-variable! 
.
 Unfortunately, this doesn’t seem to work. Running

(ly:output-def-set-variable! paper 'indent indent)

does not change the indent (paper is `(ly:parser-lookup '$defaultpaper)`).

Is it possible to set paper indents in an engraver using Scheme? Any help would 
be greatly appreciated! A small test program follows.

Many thanks,
Nate

\version "2.25.11"

\include 
"lilypond-instrument-name-measuring-engraver/instrument-name-measuring-engraver.ily"

\score {
  <<
\new Staff \with {
  instrumentName = "Name"
  shortInstrumentName = "Nm."
} {
  s1 \pageBreak s1
}

\new Staff \with {
  instrumentName = "Very very very long name"
  shortInstrumentName = "V.v.v.lng.nm."
} {
  s1*2
}
  >>

  \layout {
\context {
  \Score
  \consists #Instrument_name_measuring_engraver
}
  }
}

\paper {
  left-margin = 0.75\in
  top-margin = 0.5\in
  right-margin = 0.75\in
  bottom-margin = 0.5\in

  % Uncomment these lines to show the effect of the indents.
  % indent = 138.24456692913384\pt
  % short-indent = 73.03085039370077\pt
}