Re: Bundling Lilypond with project
Nevermind, I'm stupid. They were right above the source code downloads. On Sat, Aug 20, 2022 at 4:39 PM DoubleFelix wrote: > So I'm looking at the download page and I don't see any downloads for the > 2.23 binaries. Am I missing something, or do I need to compile them myself? > > On Sat, Aug 20, 2022 at 10:40 AM DoubleFelix > wrote: > >> Awesome! Thank you! I've heard about the Cairo backend, but I kind of >> stopped once I found out I'd have to compile Lilypond on windows, mac, and >> linux myself. I have a windows machine, a linux VM, and a hackintosh, but >> even then the process seemed very in-depth so I gave up. However, I'm glad >> to hear that the release is approaching. Thank you so much for all this >> information. I also didn't know that 2.23 was static. >> >> On Sat, Aug 20, 2022 at 1:59 AM Jean Abou Samra >> wrote: >> >>> >>> >>> Le 20 août 2022 à 05:41, DoubleFelix a écrit : >>> >>> >>> Hello, >>> I'm making a python application that uses LilyPond, but in order to make >>> it completely portable, I need to bundle LilyPond with my application. It's >>> licensed under GPL, so if I'm reading this right I should be able to do >>> that as long as I make my own project GPL (already done). >>> >>> >>> >>> I *think* that the mere act of bundling LilyPond in the app would not be >>> legally different from distributing your app and requiring that LilyPond be >>> installed separately (IANAL). Cf >>> https://www.gnu.org/licenses/gpl-faq.en.html#GPLInProprietarySystem >>> >>> >>> >>> >>> I just want to double check I'm correct, and if I am, how can I minimize >>> file-sizes when it comes to distributing the binaries? All I use is the >>> lilypond command to compile a ly file into an SVG, none of the other >>> bundled tools. >>> >>> >>> >>> For a start, if you’re doing this, I would recommend using 2.23 >>> (unstable series) binaries, because they’re static, and can be relocated at >>> will. Also, the directory layout is the same on all platforms, and they >>> already don’t contain a minimalistic GUI like the 2.22 binaries do for >>> macOS and Windows. >>> >>> I think you should be able to reduce the size by removing the Python >>> interpreter, it’s needed for scripts (musicxml2ly, convert-ly, >>> lilypond-book, etc) but not for the core lilypond command. Also remove >>> GhostScript if you only need SVG only, it’s needed to convert PS to PDF. >>> >>> Finally, you will likely be interested in the brand new Cairo-based >>> backend, which is a lot faster than the traditional SVG backend. Support in >>> the official binaries is not there yet but should come very soon with the >>> 2.23.12 release. See >>> >>> https://gitlab.com/lilypond/lilypond/-/merge_requests/913 >>> >>> >>> HTH >>> >>> Jean >>> >>>
Re: Bundling Lilypond with project
So I'm looking at the download page and I don't see any downloads for the 2.23 binaries. Am I missing something, or do I need to compile them myself? On Sat, Aug 20, 2022 at 10:40 AM DoubleFelix wrote: > Awesome! Thank you! I've heard about the Cairo backend, but I kind of > stopped once I found out I'd have to compile Lilypond on windows, mac, and > linux myself. I have a windows machine, a linux VM, and a hackintosh, but > even then the process seemed very in-depth so I gave up. However, I'm glad > to hear that the release is approaching. Thank you so much for all this > information. I also didn't know that 2.23 was static. > > On Sat, Aug 20, 2022 at 1:59 AM Jean Abou Samra > wrote: > >> >> >> Le 20 août 2022 à 05:41, DoubleFelix a écrit : >> >> >> Hello, >> I'm making a python application that uses LilyPond, but in order to make >> it completely portable, I need to bundle LilyPond with my application. It's >> licensed under GPL, so if I'm reading this right I should be able to do >> that as long as I make my own project GPL (already done). >> >> >> >> I *think* that the mere act of bundling LilyPond in the app would not be >> legally different from distributing your app and requiring that LilyPond be >> installed separately (IANAL). Cf >> https://www.gnu.org/licenses/gpl-faq.en.html#GPLInProprietarySystem >> >> >> >> >> I just want to double check I'm correct, and if I am, how can I minimize >> file-sizes when it comes to distributing the binaries? All I use is the >> lilypond command to compile a ly file into an SVG, none of the other >> bundled tools. >> >> >> >> For a start, if you’re doing this, I would recommend using 2.23 (unstable >> series) binaries, because they’re static, and can be relocated at will. >> Also, the directory layout is the same on all platforms, and they already >> don’t contain a minimalistic GUI like the 2.22 binaries do for macOS and >> Windows. >> >> I think you should be able to reduce the size by removing the Python >> interpreter, it’s needed for scripts (musicxml2ly, convert-ly, >> lilypond-book, etc) but not for the core lilypond command. Also remove >> GhostScript if you only need SVG only, it’s needed to convert PS to PDF. >> >> Finally, you will likely be interested in the brand new Cairo-based >> backend, which is a lot faster than the traditional SVG backend. Support in >> the official binaries is not there yet but should come very soon with the >> 2.23.12 release. See >> >> https://gitlab.com/lilypond/lilypond/-/merge_requests/913 >> >> >> HTH >> >> Jean >> >>
Coloring just one note in a chord
I have a basic staff defined like so: \version "2.22.2" \language "english" \new Staff { \key c \major \clef treble \numericTimeSignature < f' g' d' >1 \bar "|." } I want to make the g' note head colored in green, but if I try this, I get syntax errors about an unexpected \override: \override NoteHead.color = SeaGreen \override Stem.color = SeaGreen g' \revert NoteHead.color \revert Stem.color What am I doing wrong? Thanks, Felix
Re: Bundling Lilypond with project
Awesome! Thank you! I've heard about the Cairo backend, but I kind of stopped once I found out I'd have to compile Lilypond on windows, mac, and linux myself. I have a windows machine, a linux VM, and a hackintosh, but even then the process seemed very in-depth so I gave up. However, I'm glad to hear that the release is approaching. Thank you so much for all this information. I also didn't know that 2.23 was static. On Sat, Aug 20, 2022 at 1:59 AM Jean Abou Samra wrote: > > > Le 20 août 2022 à 05:41, DoubleFelix a écrit : > > > Hello, > I'm making a python application that uses LilyPond, but in order to make > it completely portable, I need to bundle LilyPond with my application. It's > licensed under GPL, so if I'm reading this right I should be able to do > that as long as I make my own project GPL (already done). > > > > I *think* that the mere act of bundling LilyPond in the app would not be > legally different from distributing your app and requiring that LilyPond be > installed separately (IANAL). Cf > https://www.gnu.org/licenses/gpl-faq.en.html#GPLInProprietarySystem > > > > > I just want to double check I'm correct, and if I am, how can I minimize > file-sizes when it comes to distributing the binaries? All I use is the > lilypond command to compile a ly file into an SVG, none of the other > bundled tools. > > > > For a start, if you’re doing this, I would recommend using 2.23 (unstable > series) binaries, because they’re static, and can be relocated at will. > Also, the directory layout is the same on all platforms, and they already > don’t contain a minimalistic GUI like the 2.22 binaries do for macOS and > Windows. > > I think you should be able to reduce the size by removing the Python > interpreter, it’s needed for scripts (musicxml2ly, convert-ly, > lilypond-book, etc) but not for the core lilypond command. Also remove > GhostScript if you only need SVG only, it’s needed to convert PS to PDF. > > Finally, you will likely be interested in the brand new Cairo-based > backend, which is a lot faster than the traditional SVG backend. Support in > the official binaries is not there yet but should come very soon with the > 2.23.12 release. See > > https://gitlab.com/lilypond/lilypond/-/merge_requests/913 > > > HTH > > Jean > >
Bundling Lilypond with project
Hello, I'm making a python application that uses LilyPond, but in order to make it completely portable, I need to bundle LilyPond with my application. It's licensed under GPL, so if I'm reading this right I should be able to do that as long as I make my own project GPL (already done). I just want to double check I'm correct, and if I am, how can I minimize file-sizes when it comes to distributing the binaries? All I use is the lilypond command to compile a ly file into an SVG, none of the other bundled tools. Thanks, Felix
Re: Piping contents of SVG directly to stdout
Ohhh, I missed the part about Cairo not working for cross-compilation yet. My bad. On Tue, Jul 19, 2022 at 8:51 AM Jean Abou Samra wrote: > Le 19/07/2022 à 15:43, DoubleFelix a écrit : > > > > Have you installed the necessary packages as explained in > > > https://lilypond.org/doc/v2.23/Documentation/contributor/requirements-for-compiling-lilypond#ubuntu > > > > > > Ah, I had to install a C compiler. I just found instructions for how > > to do that on SO. > > > The instructions above didn't install the compiler? OK, I would have > expected them to do so ... > > > > So now I have make install ran, so how can I construct binaries for > > various platforms from this? Can you even compile to a windows binary > > from Linux? > > > It's the way we do the official releases, and in fact the _only_ way to > create Windows binaries. To do that, you need to cd into > release/binaries/ and read README.md. But the whole problem that brought > you here in the first place was that this cross-compilation system does > not support Cairo yet. So either you are ready to figure out how to > cross-compile Cairo for MinGW and link it with LilyPond, and preferably > you contribute this to LilyPond (see partial work in > https://gitlab.com/lilypond/lilypond/-/merge_requests/913, it had some > problems with missing libraries), or you stick with running these Linux > binaries. in your Linux VM. > >
Re: Piping contents of SVG directly to stdout
> > Have you installed the necessary packages as explained in > > https://lilypond.org/doc/v2.23/Documentation/contributor/requirements-for-compiling-lilypond#ubuntu > Ah, I had to install a C compiler. I just found instructions for how to do that on SO. So now I have make install ran, so how can I construct binaries for various platforms from this? Can you even compile to a windows binary from Linux? On Tue, Jul 19, 2022 at 5:13 AM Jean Abou Samra wrote: > Le 18/07/2022 à 20:54, William a écrit : > > 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. > > I haven't completely understood the discussion, but it sounds like you > just want to use > > lilypond --svg -dcrop file.ly > > which gives you file.svg and file.cropped.svg. > >
Re: Piping contents of SVG directly to stdout
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 > <https://math.silvain-dupertuis.org/musique/Test-audition-fr%C3%A9quences.html>. > 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 <https://perso.silvain-dupertuis.org> >
Re: Piping contents of SVG directly to stdout
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
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: Piping contents of SVG directly to stdout
Sorry. I think this should reply to all now. As for the example I sent, that's the barebones type. The ones I need to generate dynamically will have random notes and key signatures and what not. I'll try WSL though. I didn't even think of using that. I'll give it a go and respond here if something comes up. On Sun, Jul 17, 2022 at 4:32 PM Jean Abou Samra wrote: > Again, please keep the list in the recipients. In your mail client, > click "Reply to all", not "Reply". > > Le 17/07/2022 à 23:19, DoubleFelix a écrit : > > Oh I see. I looked at compiling LilyPond, but I'm windows and it seems > > like a pain (I have to set up some VM for a custom OS is what I got > > from the docs). > > > You could also use the Windows Subsystem for Linux, which is > easy to install as far as I could hear (yes, Microsoft officially > provides an option to install Linux these days, which speaks > volumes...) > > > > As for my input, it's pretty barebones: > > > > \version"2.22.2" > > \language"english" > > \header{ > > tagline = "" > > } > > { > > \omitScore.TimeSignature > > \omitScore.Rest > > \keya \major > > r4 > > } > > > So you just want to show an image of a key signature? > > How about generating those images for all 15 possible > key signatures once and for all, and never calling LilyPond > afterwards? > > Jean > >
Piping contents of SVG directly to stdout
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. My question is this: Is there a way to get lilypond to write the output to stdout to save on performance, or do I need to use a file as a middleman? For reference, my current command is: "lilypond --svg --loglevel=none file.ly" Thanks, Felix