How to run batch convert / export?
Hi,
I have the Batch Convert plugin installed and active, and awant to convert a folder containing a dozen or so tunes from xml to mscz.
The plugin seems to work - I click it, tell it 'from - xml' and 'to - mscz', there are no sub-folders so I leave that blank, tell it where the folder with my xml files are - on my DropBox - click 'Select folder' and then...........
.... nothing seems to happen. I don't get a dialogue box saying which files have been converted and, as far as I can see, no new fmscz files have ben creaed - certainly not where I was expecting them - into the source folder or anywhere else.
I've run it with and without a score open in MuseScore 2, and get the same result both times.
Has anyone any ideas?
Cheers
Comments
That plugin hasn't yet been fully ported from 1.x to 2.0, just the GUI, nothing of the program logic
In reply to That plugin hasn't yet been by Jojo-Schmitz
What a pity - but many thanks for that quick reply.
Any idea when it might be ported to 2.0?
Best wishes
In reply to What a pity - but many thanks by jabu4711
When I find the time for it or someone else steps in. And when this is possible at all, I'm not 100% sure yet whether all the needed functionality is available in the qml framework
In reply to When I find the time for it by Jojo-Schmitz
Thanks so much for that exceptionally quick reply!
One PS - I was super-efficient yesterday and, when I realised I had both 1.3 and 2.0 installed I removed 1.3. Drat! Any ideas where I can find a 1.3 download? [When I go to the MuseScore site and click the 'download 1.3' button it looks as if it's downloading 2.0].
Regards
In reply to Thanks so much for that by jabu4711
Not sure where you see a "download 1.3" button
https://musescore.org/en/download#Unsupported-versions-of-Windows -> http://sourceforge.net/projects/mscore/files/mscore/ -> http://sourceforge.net/projects/mscore/files/mscore/MuseScore-1.3/
In reply to Not sure where you see a by Jojo-Schmitz
Many thanks! 1.3 downloaded and installed, plugin moved to 1.3 plugin directory, my files converted to mscz like a treat - and so quickly.
Very many thanks for your help.
[Just for the record, the link I found for downloading 1.3 which, I think, would actually have downloaded 2.0 was https://musescore.org/musescore-1.3]
Best wishes
In reply to When I find the time for it by Jojo-Schmitz
I did some investigation here, and this is what I found:
If these two problems were fixed, I think there should be no more major problems to create a plugin (at least one that does not traverse folders) because, although there's no really nice way of reading directories in qml, it can be done.
In reply to I did some investigation by heuchi
That is pretty bad. A pretty bad regression from 1.x, reg. close score see also #13301: Need means for closing a score from the plugin framework, made available in 1.2. Now reported again in #56221: Can't close a score from within a plugin.
But not being able to save a score is the real killer. Now reported in #56216: Can't save a score from within a plugin.
Why doesn't MuseScoreCore::writeScore() just use MuseScore::saveAs() rather then MuseScoreCore::saveAs()? It uses the same parameters.
And I though getting a decent GUI would have been the biggest (and meanwhile solved) problem.
In reply to That plugin hasn't yet been by Jojo-Schmitz
Is there any update on the 2.0 batch convert plugin? I've been trying to use it on OS X and it can only convert 1 file at a time before it freezes.
In reply to Is there any update on the by key-notes
Fell free to file an issue against it (https://musescore.org/en/node/add/project-issue/batch_export), I don't have a Mac to try and test, but our partner in crime ;-) heuchi has.
There is a special Mac version, of that plugin, are you using that? Are you sure to be using the latest version of the plugin?
In reply to Fell free to file an issue by Jojo-Schmitz
Yes, AFAIK I'm using the latest version for Mac: Jojo-Schmitz-batch_export-bfef5b1
In reply to Yes, AFAIK I'm using the by key-notes
There was a typo in the mac branch. I just fixed it (new version is 840d546). It should work now. Thanks for reporting.
In reply to There was a typo in the mac by heuchi
It works! Many thanks for the very fast update. :-)
FWIW, I think a better approach that a plugin is to have a batch file or shell script. There is nothing to conversion that really requires the full MuseScore interface and access to the plugin framework. "mscore foo.mscz -o foo.xml" does the conversion just fine. So a simple script that lets you select a bunch of files in your file manager (eg, Explorer on Windows, or Finder on Mac) and drag & drop them to the conversion program would do the job nicely for much less effort, I think.
In reply to FWIW, I think a better by Marc Sabatella
For a batch though, having just one MuseScore instance doing all the e.g. 500 files in one go is much faster than starting MuseScore 500 times.
In reply to For a batch though, having by Jojo-Schmitz
True. Of course, extending the command line interface to MuseScore to handle this in one go would be a reasonable option too.
In reply to True. Of course, extending by Marc Sabatella
Esp. for "export parts" we'd need an option
In reply to FWIW, I think a better by Marc Sabatella
A Windows batch command is listed in https://musescore.org/en/node/12452#comment-42073
Downside: Windows only (but should be easy to do for Linux and I guess Mac too.
Another batch method, with the added benefit of updating only the files that really need it is described at https://musescore.org/en/node/12452#comment-42050.
Downside: needs 'make' and doesn't deal with spaces in filenames.
#56216: Can't save a score from within a plugin and #56221: Can't close a score from within a plugin beeing fixed, I added back the calls to actually read, write and close the scores. So it seems to work on my Linux machine.
Please do some testing (on other platforms as well), to see if we got the main algorithm correctly.
Note: Testing is only possible using the current development version. It won't work with the v2.0 release.
TODO:
We still lack a dialog window showing we're actually doing something. This might come handy when converting a lot of files, which might take some time. We'd also need an 'abort' button.
I'm also not happy with using the pluginType: "dialog" property, because the dialog window appears somewhere on the screen (not centered) and is not modal. So the user might easily overlook it.
Two more things to be improved in the MuseScore core:
We also need some more error checking in the plugin if a score fails to read.
In reply to #56216: Can't save a score by heuchi
@heuchi: I've reformatted the code slightly and updated the readme
Just found one more thing: Every score the plugin reads, gets listed in the File->Open Recent menu. We probably don't want this.
In reply to Just found one more thing: by heuchi
Hmm, it doesn't seem to overwrite existing files?
And it seems to work on all files, irrespective of their age, it should create the target files only if they are older than the sources files
And after a few attempts it crashed MuseScore.
In reply to Hmm, it doesn't seem to by Jojo-Schmitz
I created a new branch with a modified version:
About your remarks:
It still has a (major) problem when opening files other than .mscz (e.g. midi), because on closing such a file, a dialog will pop up, asking if one wants to discard the changes made. This basically kills a batch converter, since the user will have to click once for every file processed.
In reply to Hmm, it doesn't seem to by Jojo-Schmitz
We now have a version that should work as good as the current plugin API supports.
It only works using the latest MuseScore development version and can be downloaded here.
Known limitations
I hope there are no more crashes or other problems.
If this works well, I'll try to create a pull request to overcome issues number 1 and 2.
I don't know what can be done for number 3.
In reply to We now have a version that by heuchi
I could easily live with issue 3 ;-), and 2, well, with that one I could live too, but 1 is more serious restriction, although still better than not having the plugin at all, so thanks for your work on it!
I couldn't get the conversion plugin to work either, so here is something for Linux which is quick and dirty but it works..... Warning!!! It will overwrite existing files with the target extension!!!
Change the directory and extensions to your preferences, then save it into the directory where your files are as batchconvert.py and make the file's properties executable. Double-click on it and select "Run in terminal".
In reply to I couldn't get the conversion by ChrisOfBristol
Hi,
actually the plugin should work fine. I'm having no problems here on Linux and it has been reported to work by others as well.
Can you be more specific about what problems you experience. Which version of the plugin are you using? Which version of MuseScore?
In reply to Hi, actually the plugin by heuchi
Heuchi
Nothing happens atall. I'm using Linux Ubuntu 15.10 MATE with MuseScore 2.0.2, the plugin is Jojo-Schmitz-batch_export-a71e138 which shows as batch_convert in the Plugin Manager. It was from the Musecore website somewhere, I would check, but I can't find the plugins again - they don't show when you use Search!
Chris
In reply to Heuchi Nothing happens atall. by ChrisOfBristol
Looks like you're using the latest plugin version.
Do other plugins, that require graphical dialogs work? (e.g. "Break every X measures")?
Can you invoke musescore in a shell and see if you get anything like this:
There have been some problems reported using the ppa version of musescore and I don't know if these are actually fixed for your distribution.
In reply to Looks like you're using the by heuchi
"Do other plugins...work?"
The sample plugin called 'helloqml' sort of works. It displays a window which says "Hello Qml" if you define a shortcut and type it, but nothing happens if you click on it.
"Can you invoke musescore in a shell"
chris@HPC:/$ mscore
initScoreFonts 0xb317be0
init Help from:
cannot setup data for help engine: Cannot open collection file: /usr/share/mscore-2.0/manual/doc_en_GB.qhc
chris@HPC:/$
"There have been some problems reported using the ppa version of musescore"
This was directly from the distribution's "App Grid".
I'm afraid I'm unlikely to pursue this topic:
The Editor is terrible! It only allows formatting by typing HTML tags. What is worse is that I keep getting the "You have exceeded the maximum number of posts you can make." I have made about 5 posts!
In reply to Heuchi Nothing happens atall. by ChrisOfBristol
https://musescore.org/plugins should be the place...
And indeed a71e138 is the latest Version
And what heuchi wrote is indeed the most likely cause for it not to run at all.
In reply to Hi, actually the plugin by heuchi
"Do other plugins...work?"
The sample plugin called 'helloqml' sort of works. It displays a window which says "Hello Qml" if you define a shortcut and type it, but nothing happens if you double-click on it.
"Can you invoke musescore in a shell"
chris@HPC:/$ mscore
initScoreFonts 0xb317be0
init Help from:
cannot setup data for help engine: Cannot open collection file: /usr/share/mscore-2.0/manual/doc_en_GB.qhc
chris@HPC:/$
"There have been some problems reported using the ppa version of musescore"
MuseScore was installed directly from the distribution's "App Grid".
I'm afraid I'm unlikely to pursue this topic.The Editor is terrible! It only allows formatting by typing HTML tags. What is worse is that I keep getting the "You have exceeded the maximum number of posts you can make." error. I have made about 5 posts! It means my posts error so I have to save them elsewhere, then wait a while before I can make another attempt to post them.
It only took half an hour to write the Python script, which is a lot less bother :)
In reply to "Do other by ChrisOfBristol
OK, so you rest your case then, if I understand you correctly?