Lubuntu graphic support

• Apr 22, 2013 - 16:02

I use Musescore in an education setting. I create presentations using Libreoffice Impress and project them on a wall. I have been using Musescore to notate simple songs for my students to play on the recorder. I'm running Lubuntu on a half dead dog of a system that won't boot windows (or I would be using Powerpoint).

Exporting a score in .png format creates a bitmap with transparent background. This is a problem in a program like Impress because it significantly reduces the amount of "real estate" to grab to select and edit the image. Furthermore, it scales poorly, so blowing up small images creates fuzzy, unclear images. Sometimes, lines of the staff disappear.

I've tried exporting with vector graphics, but these images don't render correctly. They are all kinds of garbled with incorrect characters. I assume it is because the fonts aren't installed correctly.

So, the $10,000 question is... what can I do to improve this? How does one install the fonts for vector graphics to work? Can I make .png files have a background color?

Many thanks in advance.


Comments

I don't know the details, but I do know SVG export is problematic in 1.X.

You can control the resolution used to save PNG's, so resizing isn't necessary. You can do it globally using the "-r " command line option, or if you are using the Snippet Creator plugin (available from the plugin repository onthis site - see Plugins at right), you can edit the line in the javascript file that sets the resolution. Since you mention LibreOffice, you could also try my Musescore Example Manager extensiom for LibreOffice, available from the LibreOffice extensions site. I doubt it would work directly in Impress, but if you don't doing scratch pages in Writer then copying and pasting to Impress, that should work fine, and give you perfectly sized examples right off the bat. Another possibility if your examples are sufficiently simple to not tax a somewhat unstable program still in development: try a nightly build of MuseScore 2.0 (see downloads link in menu at right of this page), which allows you to set DPI of exported graphics in Edit / Preferences. It also has a nice "Foto mode" where you can select a region for export, and select the resolution and background transparency.

If you want the background to not be transparent, you could turn on the screen shot option in Edit / Preferences / Export - this will cause it to grab the paper texture, I think. But also other screen-only graphics like greyed-out invisible elements, system breaks, etc. If you're main reason for not liking transparent backgrounds is that you are constantly resizing too-small graphics, that problem will go away once you use one of the methods I mentioned to create more appropriately sized examples right off the bat.

In reply to by Marc Sabatella

Thank you for the many suggestions.

I'm trying to use your Musescore Example Manager extension, but I'm stumped. I do not know the musescore executable path. This wouldn't be a problem if I was in windows, but I'm still learning linux.

Is it worth trying the nightly build of 2.0 or do you think I should just figure out the resolution I need for the .png?

Thanks again

In reply to by studley music

There should be no blank space above and beyond what is contained *within* your score. So I'm guessing maybe you have a title, copyright notice, or other element in the margin somewhere so this is dutifully being include in the crop. Make sure you score contains nothing but the actual measures you want.

In reply to by studley music

Unfortunately for our purposes here, the extension adds examples as links only, so sending me the document itself didn't really help much. This is one of those few cases where seeing a screen shot would be better, so I can see what you are saying. Is it possible you originally started with a version of that example that was a full page (copyright message) and you removed the message but didn't resave it until after you tried adding it to your text document?

Where I tried adding your example to your document myself, it worked just fine. So perhaps save it under another name and try again?

In reply to by Shoichi

Getting rid of the extra whitespace is easy enough, but I'm getting the impression that it should not be there. The images still scale poorly. I need to figure out how to configure musescore to export higher resolution .png

Or figure out musescore 2.0. I'm a little bit afraid to make the switch, and I don't have much available time to troubleshoot my poor old pc if it gets borked.

In reply to by studley music

Here's my next guess: you might have the "screen shot function" option turned on in MuseScore (edit / preferences / export), which causes the graphic that ges generated to onclude the paper texture rather than being completely empty space. If that is the case, then that would explain why it is not being automatically cropped down to size.

If you *don't* have that option turned on, then then next thing I'd ask you to do is to look in the folder comtaining the example and see what files are present. Under normal circumstances, you would see the MSCZ file and a PNG file for each example. Perhaps also the backup "MSCZ," file. If something has gone wrong, you might also see a second PNG file, with "-1" (I think) appended to the filename. What is supposed to happen is that the extension forces MuseScore to generate a PNG, and then the extension gives that PNG to ImageMagick to trim the excess white space. If for some reason that operation is failing and the extension isn't properly detecting that, then I could imagine you would be left with an untrimmed PNG file. Like maybe there is an a previous version of the PNG file there but it is marked read only so the ImageMagick can't overwrite it. Or the PNG file is open in another process which would also prevent the write from succeeding.

So, what files exist for that example? Can you delete any PNG files and try again?

In reply to by studley music

Be sure to resave your score after example after turning the option off, or the extension won't ask MuseScore to regenerate the PNG.

If that doesn't do it, then looking at the actual PNG's wild be the next step. Posting one could be interesting. Also the file where the extension saves its own settings. To be honest, I don't remember where that is on Linux. But I'm wondering if you perhaps didn't enter the command line correctly when you set it up, s it's not dong the trimmng it is supposed to.

In reply to by Marc Sabatella

I'm getting nowhere, so I tried to experiment with Musescore 2. Unsurprisingly, I was not able to make it work. I extracted the tar.bz2 to its own directory, removed old musescore (sudo apt-get remove) and now I'm left with an executable file named mscore that refuses to execute. I'm all out of ideas here. Can you nudge me in the right direction.

Thank you for the time you have already invested in my problem.

In reply to by robert leleu

When you say "easily adapt", do you mean "easily adapt for someone with a solid understanding of coding" or do you mean "easily adapt for someone who spent 3 days trying to get Dropbox to start at boot"? Because I'm definitely the second one.

That said, I'm not afraid to adventure into deep waters, just so long as I have half a clue what I'm trying to do. I dunno. Is this something that I could just jump into?

I'm running Lubuntu on old-ass hardware. I have minimal experience using GitHub and compiling via terminal. On a scale from 1 - 10, I would rate my GNU/Linux expertise at about 2.

In reply to by robert leleu

A couple questions:

1) I notice a bit of french. Do I have to translate into english for this to work on my system?
cd $MUSEPATH
#construction du nom du fichier à placer sur site
date=$(stat -c %y ./build.release/mscore/mscore)
jour=${date:0:10}
heure=${date:11:2}
minute=${date:14:2}
fin=$(<./mscore/revision.h)
nom="mscore-"$jour"-"$heure"-"$minute"-"$fin

2) I know very little about code, but is "fi" supposed to be "if" or is it correct?
else
zenity --info \
--text='Nouvelle version de MuseScore !'$REVISION_OLD' => '$REVISION --display=:0
fi
export CFLAGS="-m32"
make
echo mysystempassword | sudo -S make install

In reply to by studley music

The nighlies are definitely worth checking out. As long as you aren't trying to do anything too terribly complication, they should be stable enough, and besides, if it crashes in the middle of reating a four measure excerpt, how hard could it be to fire it up and try again?

My sense is if you are just doong a handful of these, the new Foto mode in 2.0 is the easiest way to go. If you are doing dozens of them and perhaps not just as throwaways but as part of an ongoing project, then the LibreOffice extension startsto really pay off.

Try this

In Layout...Page Settings, set the dimensions to a multiple of your slide size (e.g. 160 x 120) and set the margins to a low value (maybe 5).

Save As a .png file

From the command line do:
convert -flatten -density 200 file.png new_file.png

Now try importing new_file.png into Impress and size it as you need it.

convert will also convert .pdf to .png which you can then edit with any simple graphics program.

Do you still have an unanswered question? Please log in first to post your question.