Re: Output PDF to stdout

2024-01-21 Thread Valentin Petzel
Hello Vlad,

You will not avoid intermediate files in any case, as Lilypond with gs output 
will generate ps code, which is then turned into a pdf. If you want to pipe 
PDFs for convenience you might create a wrapper say plilypond in the search 
path doing something like this:

#!/bin/bash

t=$(mktemp) 1>&2
lilypond -o "$t" ${@} 1>&2
cat "$t".pdf
rm "$t".pdf 1>&2

Cheers,
Valentin

Am Donnerstag, 4. Jänner 2024, 23:34:28 CET schrieb 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



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


Re: Output PDF to stdout

2024-01-13 Thread Hans Aikema
On 13 Jan 2024, at 02:05, Curt McDowell  wrote:Have you actually tried this? LilyPond appends ".pdf" to the output filename (and ".midi"). If you try to make the fifo ending in ".pdf", you find lilypond removes the fifo before writing a new file. For the same reasons, the output file cannot be /dev/stdout. Maybe you could write something exciting using FUSE or Docker.On 1/7/2024 5:41 AM, Raphael Mankin wrote:On 05/01/2024 03:46, David Wright wrote:Alternatively, use a fifo, e.g. fifo=/var/tmp/ly-pdf$$rm -rf $fifomknod  $fifo pcat source.ly | lintLy | lilypond -o $fifo &optimizePDF  < $fifo > score.pdfwaitrm -rf $fifoA trick I learned when doing Oracle backups. It also would not write to stdout.As an offtopic sidenote: even if it worked/works, according to the man-pages of mknod mkfifo should be preferred over mknod to create the FIFO."POSIX.1-2001 says: "The only portable use of mknod() is to create a FIFO-special file.  If mode is not S_IFIFO or dev is not 0, the behavior of mknod() is unspecified."  However, nowadays one should never use mknod() for this purpose; one should use mkfifo(3), a function especially defined for this purpose."

Re: Output PDF to stdout

2024-01-12 Thread Curt McDowell
Have you actually tried this? LilyPond appends ".pdf" to the output 
filename (and ".midi"). If you try to make the fifo ending in ".pdf", 
you find lilypond removes the fifo before writing a new file. For the 
same reasons, the output file cannot be /dev/stdout. Maybe you could 
write something exciting using FUSE or Docker.


On 1/7/2024 5:41 AM, Raphael Mankin wrote:

On 05/01/2024 03:46, David Wright wrote:
Alternatively, use a fifo, e.g. 


fifo=/var/tmp/ly-pdf$$
rm -rf $fifo
mknod  $fifo p
cat source.ly | lintLy | lilypond -o $fifo &
optimizePDF  < $fifo > score.pdf
wait
rm -rf $fifo

A trick I learned when doing Oracle backups. It also would not write 
to stdout.




Re: Output PDF to stdout

2024-01-07 Thread Raphael Mankin




On 05/01/2024 03:46, David Wright wrote:

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.



Alternatively, use a fifo, e.g.

fifo=/var/tmp/ly-pdf$$
rm -rf $fifo
mknod  $fifo p
cat source.ly | lintLy | lilypond -o $fifo &
optimizePDF  < $fifo > score.pdf
wait
rm -rf $fifo

A trick I learned when doing Oracle backups. It also would not write to 
stdout.


--
Political correctness: a kind of McCarthyite movement in reverse which,
in the name of tolerance proscribes all reference to gender, ethnicity,
color of skin, sexual preference, social provenance and even age. It has
no leaders, as far as I am aware, only terrified disciples. - John le Carre



Re: Output PDF to stdout

2024-01-05 Thread Volodymyr Prokopyuk
Thank you very much for your thoughts!

I expected that the PDF output to stdout would be difficult to implement
due to multiple Lilypond backends, and, probably, is not a real bottleneck
in PDF generation. It is nice to know that intermediary files are already
handled by a FS cache, and can be externally optimized by using a RAM disk.

Thank you,
Vlad

On Fri, Jan 5, 2024 at 4:46 AM David Wright 
wrote:

> 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: 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: 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/



Re: output PDF

2015-01-12 Thread Paul Morris
Welcome to LilyPond!


Peter Jongh Visscher wrote
> I started using Lilypond and the in the PDF output the first line(staff)
> jumps a little bit forward(see Example)
> 
> I can not find a command  to set all the staff starting at the same point.

For this, use "indent = #0" in the \layout block as shown here:
http://lilypond.org/doc/v2.18/Documentation/notation/line-length#index-indent-4

Cheers,
-Paul



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/output-PDF-tp170381p170385.html
Sent from the User mailing list archive at Nabble.com.

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


Re: output PDF

2015-01-12 Thread Kieren MacMillan
Hi Peter,

> I started using Lilypond

Welcome to the ‘Pond!!  =)

> I can not find a command  to set all the staff starting at the same point.

\paper { indent = 0\in }

See 

 for more information on how to control horizontal spacing things like paper 
size and margins.

Hope this helps!
Kieren.
___

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


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


RE: output PDF

2015-01-12 Thread Mark Stephen Mrotek
Peter:

 

Use:

\layout { indent = #0 }

 

Mark

 

From: lilypond-user-bounces+carsonmark=ca.rr@gnu.org
[mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org] On Behalf Of
Peter Jongh Visscher
Sent: Monday, January 12, 2015 7:55 AM
To: lilypond-user@gnu.org
Subject: output PDF

 

I started using Lilypond and the in the PDF output the first line(staff)
jumps a little bit forward(see Example)

I can not find a command  to set all the staff starting at the same point.

 

Met vriendelijke groet,

 

Peter Jongh Visscher

Stationsweg 172

1852 LN HEILOO

telefoon  +31 (0)72 532 1728

mobiel  +31 (0)615 418 434

e-mailpe...@pljv.nl

 

De informatie verzonden met dit e-mail bericht kan vertrouwelijk zijn en is
uitsluitend bestemd voor de geadresseerde.

Gebruik van deze informatie door anderen dan geadresseerde is verboden.
Openbaarmaking, vermenigvuldiging, verspreiding en/of verstrekking van deze
informatie aan derden is niet toegestaan.

 

"De aarde is geen geschenk van onze ouders, hij is aan ons in bruikleen
gegeven door onze kinderen." (Indiaans spreekwoord)

 

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


Re: output PDF

2015-01-12 Thread Brian Barker

At 16:54 12/01/2015 +0100, Peter Jongh Visscher wrote:
I started using Lilypond and the in the PDF output the first line 
(staff) jumps a little bit forward (see Example)

I can not find a command to set all the staff starting at the same point.


Try:
\layout { indent = #0 }

I trust this helps.

Brian Barker


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


Re: Output PDF has different chord font than expected

2013-02-27 Thread mayornancy
Xavier,

Thank you for explaining the root cause of this frustrating problem.

Based on your solution, I am now able to use the chord font of my choice by 
adding the following snippet at the top of my source file (in this case 
Verdana, which ships natively with Win7)

\paper  {
  #(define fonts
    (make-pango-font-tree "Times New Roman"
  "Verdana" 
  "Luxi Mono"
  (/ staff-height pt 20)))
}


Your help is greatly appreciated!

Greg





 From: Xavier Scheuer 
To: mayornancy  
Cc: "lilypond-user@gnu.org"  
Sent: Wednesday, February 27, 2013 6:43 PM
Subject: Re: Output PDF has different chord font than expected
 
On 27 February 2013 20:29, mayornancy  wrote:
> Hello,
>
> I am using lilypond (2.16.2) on Windows7 SP1 in "portable" mode (I simply
> extracted the installer to a folder).
>
> After compiling the following Chord example found at:
>
> http://lilypond.org/doc/v2.12/input/lsr/lilypond-snippets/Chords#Single-staff-template-with-notes-and-chords
>
> my result PDF chord symbols are using a very different font than the example
> output shown on the webpage (please see attached png)
>
>
> Is there some registry/environment setting I have to manually adjust in
> order for the default lilypond chord font to be used?

Apparently it's a Windows bug.
http://lists.gnu.org/archive/html/lilypond-user/2012-12/msg00542.html
http://www.theregister.co.uk/2012/12/17/windows_security_update_kills_fonts/

Define New Century Schoolbook as default roman (serif) font, thanks to
explanations from NR 1.8.3 Fonts > Entire document fonts
http://lilypond.org/doc/v2.17/Documentation/notation/fonts.html#entire-document-fonts

Cheers,
Xavier

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


Re: Output PDF has different chord font than expected

2013-02-27 Thread Xavier Scheuer
On 27 February 2013 20:29, mayornancy  wrote:
> Hello,
>
> I am using lilypond (2.16.2) on Windows7 SP1 in "portable" mode (I simply
> extracted the installer to a folder).
>
> After compiling the following Chord example found at:
>
> http://lilypond.org/doc/v2.12/input/lsr/lilypond-snippets/Chords#Single-staff-template-with-notes-and-chords
>
> my result PDF chord symbols are using a very different font than the example
> output shown on the webpage (please see attached png)
>
>
> Is there some registry/environment setting I have to manually adjust in
> order for the default lilypond chord font to be used?

Apparently it's a Windows bug.
http://lists.gnu.org/archive/html/lilypond-user/2012-12/msg00542.html
http://www.theregister.co.uk/2012/12/17/windows_security_update_kills_fonts/

Define New Century Schoolbook as default roman (serif) font, thanks to
explanations from NR 1.8.3 Fonts > Entire document fonts
http://lilypond.org/doc/v2.17/Documentation/notation/fonts.html#entire-document-fonts

Cheers,
Xavier

-- 
Xavier Scheuer 

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


Re: Output PDF has different chord font than expected

2013-02-27 Thread mayornancy
Federico,

Thanks for your suggestion.
I downloaded and installed the font families from your screenshot (all 3 were 
missing from my PC), but this has not solved the problem. I can reproduce the 
same font problem on a second PC (running Win7 x64). Any other ideas?

Greg







 From: Federico Bruni 
To: lilypond-user@gnu.org 
Sent: Wednesday, February 27, 2013 4:27 PM
Subject: Re: Output PDF has different chord font than expected
 
Il 27/02/2013 20:29, mayornancy ha scritto:
> After compiling the following Chord example found at:
>
> http://lilypond.org/doc/v2.12/input/lsr/lilypond-snippets/Chords#Single-staff-template-with-notes-and-chords
>
> my result PDF chord symbols are using a very different font than the
> example output shown on the webpage (please see attached png)

Actually the fonts are the same even in the latest version:
http://lilypond.org/doc/v2.17/Documentation/snippets/chords#chords-single-staff-template-with-notes-and-chords

I guess that your operating system is missing the fonts required.
My system (Linux) is using the fonts you see in the attached image.

-- 
Federico

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


Re: Output PDF has different chord font than expected

2013-02-27 Thread Federico Bruni

Il 27/02/2013 20:29, mayornancy ha scritto:

After compiling the following Chord example found at:

http://lilypond.org/doc/v2.12/input/lsr/lilypond-snippets/Chords#Single-staff-template-with-notes-and-chords

my result PDF chord symbols are using a very different font than the
example output shown on the webpage (please see attached png)


Actually the fonts are the same even in the latest version:
http://lilypond.org/doc/v2.17/Documentation/snippets/chords#chords-single-staff-template-with-notes-and-chords

I guess that your operating system is missing the fonts required.
My system (Linux) is using the fonts you see in the attached image.

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