Hi,

> Hello, I’m wanting to (on-demand, relatively quickly) pass an LY file via 
> stdin
> and then receive rendered png output from stdout. I’ve tried this with the
> `lilypond' binary, but no matter what I do it takes a very long time and
> generates a ton of extra formats that I don’t need. Anyone have any ideas?

Reading from stdin is absolutely possible though, just pass `-` as filename. 
Writing to stdout is going to be a bit more complicated (of course there is the 
issue that Lilypond does not necessarily output a single file). So best maybe 
create a wrapper around lilypond that essentially does

lily-to-stdout:
#!/bin/bash

set -e
target=$(mktemp -d)
trap 'rm -r "$target"' EXIT

lilypond -o "$target/" --png "$@" >&2

# Combine to single file
magick "$target/"*.png -append "$target/final.png" >&2

cat "$target/final.png"
# EOF

and then call `lily-to-stdout path/to/file.ly` or `... | lily-to-stdout -` or 
something.

Cheers,
Tina

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

Reply via email to