Suggestion: a good start for footnotes Insert > Char > Footnote#

Previous topic - Next topic

dragonfly

Searching the lilypond forum (which might be more informative for researching such errors) I read here
http://lilypond.1069038.n5.nabble.com/Spaces-in-filenames-don-t-work-with-danti-alias-factor-option-td72186.html
that this error occurs with spaces in filenames.

Does this message occur with a simple file name like test.ly? No underscores.
I saw no error messages in my test run.

It may not like underscores in filenames (I'm surmising).

Incidentally I don't think that ImageMagick is needed yet.


jack_cat

No, there are no spaces in the file name but there are under-scores.

After a while Gimp did open the big file and you may see a screen shot of the image properties attached.



[attachment deleted by admin]

jack_cat

OK, I took the underscores out of the file name and ran the command line string again, but it did not fix anything.

This time, "fatal error" message (see screen shot) and also, "pngtopnm is an unrecognized command" (neither of which happened the last time, sorry again I omitted to take a screen shot then), BUT the new output included a new .old file which is 4 megs, and also a .ps file - there was a .ps file output from the previous experiment also, which I hadn't noticed.

The .ps file could no doubt be converted.

This is all, I suppose, really in the province of the Lilypond developers. I have not yet joined the Lilypond mailing list - they have no forum - although I have searched the mailing list often lately. The bottom line here is the answer to the question "considering the current state of both open-source software programs, what Lilypond output works in Scribus now?" and we have one answer - the hi-res but not anti-aliased ,png file, as well as some interesting information. There does not appear to be any problem with Scribus. All of the problems have been generated by Lilypond. We have wandered far off the original topic of the footnotes, with unexpected but very interesting results, and the discussion has been very helpful and has certainly given me some useful new tools to work with.

Perhaps ImageMagick has amongst its utilities a different program also called pngtopnm, which would give different results from the GNU program that I found and installed, if invoked by Lilypond.   

[attachment deleted by admin]

jack_cat

I overlooked that I could scroll up in the command line window and find the previous command string run, so here is a screen shot of both processes for comparison.

[attachment deleted by admin]

jack_cat


dragonfly

No .. I did not use ImageMagick .. that was a guess.

I did run this command in Ubuntu ...

pngtopnm --version
pngtopnm: Using libpbm from Netpbm Version: Netpbm 10.0
pngtopnm: BSD defined
pngtopnm: RGB_ENV='RGBDEF'
pngtopnm: RGBENV= 'RGBDEF' (env vbl is unset)

Check if you have pngtopnm library installed in Windows.

http://www.libpng.org/pub/png/apps/pnmtopng.html

Incidentaaly one of your reports shows file size 3.5 GB. This is very large.
I would focus on compiling smaller files into png and then concatenate the result.
Remember the discussion about merging fragments of markdown?

Lily-book might be worth exploring.

jack_cat

That 3.5 gig file size comes from Lilypond's attempt to process my .ly  source file which is only about 4 kilobytes.
I didn't make an  .ly file that big! And without the anti-aliasing command it exports to a .png at 191 kilobytes, no problem. The huge files are all artifacts of the process generated by the extra command:

-danti-alias-factor=10

I though that the GNU program I installed a little while ago had included pngtopnm, but running

pngtopnm --version

from the command line gives me the error message, "not a recognized command"... my goof some way, I will look at this some more. The program is on my computer and installed, see screenshot. I also put its directory in the path, but still get "unrecognized command" from the command line.

I have been considering Lily-book, it does appear to be Lilypond's own in-house way to do what Scribus does, but as I am still dealing with basic input code in Lilypond, it will probably be a while before I am ready to tackle it.

[attachment deleted by admin]

dragonfly

Found this post ...

http://lilypond.1069038.n5.nabble.com/pngtopnm-missing-tc40933.html

Also reading backgrounds from this site ..

http://www.libpng.org/pub/png/apps/pnmtopng.html
and here ..
http://www.acme.com/software/pbmplus/
and here ..
http://www.schaik.com/png/pnmtopng.html

pnmtopng is a Unix library and there are some binaries for Windows.

===================

and more from Lilypond forum.

http://lilypond.1069038.n5.nabble.com/pngtopnm-missing-tc40933.html

QuoteI'm sorry I still can't answer your exact question, but I can give some pointers.  pngtopnm is a standard image file format converter on unix boxes, and so I guess Lily assumes it's there for some of its operations, and it isn't on Windows.  Hence the error message.

In my experiments, using --png with -dresolution=nnn gives exactly the same output as -dresolution=nnn/3 -danti-alias-factor=3 - so it appears not worth using the anti alias factor at all.  Accepting that you will never get an image file as good looking as PDF, since PDF scales, then something like lilypond --png -dresolution=900 should give you a better image than you need.

Thus this explains why I can run error free (in Unix) but you cannot (in Windows).  Try dropping -danti-alias-factor entirely.  And finally have you tried importing pdf into Scribus?


a.l.e

the scribus way of importing of svg has been modified in a way that it should work ok for the most common cases:

https://bugs.scribus.net/view.php?id=15454

the lillypond project should still explicitly set the background color.

depending on your platform, you can get the newest snapshot and get the import to work correctly!

dragonfly

Some progress here on svg compatibility on the LilyPond side ...

https://sourceforge.net/p/testlilyissues/issues/5429/

Importing svg from LilyPond might give cleaner images than importing png.
Certainly svg can be further edited/tweaked in Inkscape.


jack_cat

(a)
Quote from: dragonfly: "Thus this explains why I can run error free (in Unix) but you cannot (in Windows).  Try dropping -danti-alias-factor entirely."
OK, I am glad to set that to rest. Not necessary to use anti-alias factor or mess with invoking pngtopnm on Windows. Another random-rat-maze learning experience: there is nothing down that hole.

(b)
Quote from: dragonfly: "And finally have you tried importing pdf into Scribus?"
DF quoting from someone on the Lilypond mailing list: 
Quote from: unknown"Accepting that you will never get an image file as good looking as PDF, since PDF scales, then something like lilypond --png -dresolution=900 should give you a better image than you need."
No, I have not yet tried importing .pdf into Scribus.
I had naively assumed that .pdf was not intended for any use other than public document distribution, and I was completely unaware that "you will never get an image file as good looking as PDF" (since many of the pdf's I read are scans of fairly marginal quality and that is what I am used to) and so, I hadn't considered it.

I will re-evaluate this of course. But the only presenting reason for importing .pdf into Scribus, at the moment, is that .pdf might give better results with the export of Lilypond content than .png. The proof is a simple matter of exporting identical content from Lilypond in both formats and printing a page containing both; I'll get to it (ahh, it's inconvenient because I got fed up with the frequent planned obsolescence of consumer printers and ink cartridges, and don't keep one, so I have to go out.) But as the Lilypond list poster said, it should easily be possible to increase the .png resolution to the point where any difference is imperceptible. 300 dpi seems adequate, 600 dpi would be overkill ? and 900 more so.

By the way, I had an email exchange with the guy who wrote Lily-compile, who says that he had never intended for Lily-compile to do finished output (which he himself does from the command line) but that he intended it only for instant code checking from within Atom in the process of writing Lilypond code. However, given that Lily-compile can accept any command string that could be used on the command line, I don't see the benefit of this position, and I don't see any difference in the output.

(c)
Quote from: dragonfly: "Importing svg from LilyPond might give cleaner images than importing png"
I have had this in mind all along as a possibility and assumed it when I started in with Lilypond a month ago, but now having done a number of draft prints from my Scribus files, including one from my local pro printer who didn't complain about the image quality, I don't see that anything is lacking in the .png files that I have been using to date. (It could be that I don't know what the print standard really should be and that my printer was just humoring me. But the image quality has not been an issue with my draft prints. )

The "might give cleaner images" is not very compelling now that I have hi-res .png files available, particularly if I have to get into tweaking the .svg code for every file, adding an extra step. What _would_ be a reason for using .svg, is if there is some graphical result that I cannot figure out how to accomplish with Lilypond code, such that I would want to open the file in Inkscape and push the GROBs around or add some more elements. I can imagine this as a likely scenario, but the Lilypond docs assure me that Lilypond has every possible tweak built in, and so far I have found code snippets to do everything I have needed.

The bottom line for me is that a bird in the hand is worth two in the bush, so if I have something that works well enough, I am happy. If I determine that one thing works and another doesn't, I am inclined to go with what works now and not wrestle for too long with the problem of why the other thing doesn't work, because for me, such quests have so often ended in a morass because of my lack of technical knowledge. I do, however, very much appreciate the work of those who are capable and motivated to wrestle with those problems, because otherwise all of this open-source software would not exist. Thanks!

Dragonfly, when do you think that you may have a version of the Markdown-to-Scribus pipeline ready to test?

dragonfly

@jack_cat

It appears that you now have your act together. I understand your philosophy to stick with something that works. "a bird in the hand is worth two in the bush".

Regarding importing pdf objects into Scribus renderframes I am referring to advice I read in this Scribus forum.
But if you have high quality png objects then continue down that path.

Regarding Lily-compile, as I have written earlier, that is a simple wrapper using a single lilypond command.  If you require to change the command you have to go into Settings.

I have found in my experiments that installing the Atom package scripts offers more flexibility as you learn how to leverage lilypond commands.

apm install scripts

Basically you create a folder named (say) lilypond/commands and in there build a library of one liner bash scripts drawn from lilypond command line documents.

Here is a simple example of one bash script (Ubuntu notation):

#!/bin/bash

filename="$HOME/Atom-repo/music-experiment/example.ly"
lilypond --png -dresolution=300 $filename


Then in atom you can navigate to that library, select and highlight a script in tree-view, select Packages > Script > Run Script.

This has the same effect as Lilypond > Compile.  The difference is that you can create a large library of lilypond (and lily-book) commands without the need to dive into Settings each time.

On the subject of svg you write ...

QuoteWhat _would_ be a reason for using .svg, is if there is some graphical result that I cannot figure out how to accomplish with Lilypond code, such that I would want to open the file in Inkscape and push the GROBs around or add some more elements.

In fact svg comes into its own if you wanted to animate or scale the musical notations much as I showed in earlier links to websites with continuous scrolling.

However you are today focussed on static printing and this advantage of using svg objects does not apply to your project of writing a book.

Finally on my task to create a pipeline from markdown to Scribus document model at least I do now see the way forward.  However I am juggling several tasks and I cannot set a fixed date to rely on. Not too far ahead I hope.

jack_cat

Dragonfly: Now I am really off topic but please indulge me: This is a question about copying, pasting, and auto-indentation in Atom.

While editing a lilypond file in Atom, it is very convenient (per the recommendations from lily users) to write one measure at a time and run lily-compile to check the output before going further (as it is really easy to screw up and then have difficulty finding the error). To make this easy, I copy and paste the code from an entire previous measure, 3 or 4 lines usually, and then edit that, rather than re-typing.

Atom has some kind of auto-indent feature which confuses me. SOMETIMES when I copy and paste such a code block, it indents it the same as the block above. OTHER times, it re-indents the whole block and thus the pasted blocks wander farther and farther toward the right side of the window unless I then delete all of the extra tabs and spaces at the beginning of the lines.

What don't I understand about this feature?
Thanks...

Re: using scripts in Atom: running Lilypond from a command line script:
this is a good idea and thank you, I will try it when I am ready for it...!

right now the stage that I am at w/ Lilypond, is that I type a few measures,stumble onto a new tool or technique that I will need to be able to use, (today, placing a "suggested accidental" above the staff and then pushing it around so that it looks better), and then spend an hour or two looking through the docs for the necessary code snippet and trying to understand it, and then type a few more measures.... I am devoting one day a week, more or less, using whatever musical excuse comes up for trying some new Lilypond techniques. I think it is going very well.

jack

dragonfly

QuoteTo make this easy, I copy and paste the code from an entire previous measure, 3 or 4 lines usually, and then edit that, rather than re-typing.

You might find the Atom "snippets" feature to be useful. There are two types of snippets.cson files.

One is global, found by Edit > Snippets and is the default core package installed .
Another is local (to each project) and requires the package "modular-snippets" to be installed. The local snippets.cson file is then located at the root of each project.

You can then build a snippets library of lilypond scripts you want to paste. You will need to learn how to use this feature. Basically in snippets.cson you write some alias which refers to the block of music notation.  To use the snippet you go to the start of a line, type the shortcode alias, then tab. this pastes the snippet into the editor.

QuoteAtom has some kind of auto-indent feature which confuses me. SOMETIMES when I copy and paste such a code block, it indents it the same as the block above. OTHER times, it re-indents the whole block and thus the pasted blocks wander farther and farther toward the right side of the window unless I then delete all of the extra tabs and spaces at the beginning of the lines.

What don't I understand about this feature?

Start by selecting the pasted code and then applying .. Edit > Lines > Autodent to see if that fixes the rogue indents.
There are two further features:
Edit > Lines > Indent
Edit > Lines > Outdent

this tip was found here ...

https://www.sitepoint.com/12-favorite-atom-tips-and-shortcuts-to-improve-your-workflow/

under Auto Indent.
"One annoyance I have is when I copy code from somewhere and the indentation is all over the place. Luckily, Atom has you covered. Select the code and head to Edit > Lines > Auto Indent."

There might be another cause but try this first.

Quote... and then spend an hour or two looking through the docs for the necessary code snippet and trying to understand it.
.

Surely we can improve on this turnaround time for research. 
I would start by copying the entirety of lilypond repository (snippets) and doc (separate downloads) into a local folder in Atom repo to avoid hopping to and fro between Atom editor and documents.

The repository of snippets is here.

http://lilypond.org/snippets.html

http://lsr.di.unimi.it/download/

http://lsr.di.unimi.it/download/lsr-snippets-all-2018-10-23.tar.gz

I will try out one or two tools I use for searching local repositories.

dragonfly

Re: unwanted indent of pasted text in Atom ...

After further study of Settings ...

Open Settings Panel (Edit > Preferences)

Open the Editor settings panel link (just below Core link at top)

In there are these settings ..

Auto Indent                  .. default is enabled
Auto Indent on Paste     .. default is enabled

Try unticking Auto Indent on Paste.