MS4 - Batch Processing - MusicXML parts
I posted this yesterday and got no traction. Maybe I had the wrong section (or this is just too niche). Anyways:
I successfully made a script with the help of ChatGPT that exports the MIDI file and MusicXML file for all files in a folder. I will attach it to this thread as a txt file instead of ".sh". For the life of me, ChatGPT, and Gemini, "we" cannot figure out how to export the Piano part for the MusicXML. Fairly certain I am not messing up on this. Is this not possible with the command line?
Attachment | Size |
---|---|
export_musescore copy.txt | 1008 bytes |
Comments
I don't use command prompt scripts at all, but the way to bet is that ChatGPT's contribution is wrong, and probably even nonsensical.
In reply to I don't use command prompt… by TheHutch
Certainly possible. I was pleasantly surprised it help me create the script that batch exported MIDI and XML's correctly. I am not a programmer by any means. I have dabbled with command line/terminal briefly but not my area of expertise. From what I have gathered, it seems to be a limit of Musescore API. But, I (or ChatGPT) could be wrong....
It'd be easier and quicker to use a JSON file and feed that into MuseScore, check https://handbook.musescore.org/appendix/command-line-usage#run-a-batch-…
In reply to It'd be easier and quicker… by Jojo-Schmitz
Interesting. You were the EXACT person I thought would know this. I am so glad you reached out. Thank you! I can try giving this a look and see if I can figure it out with the assistance of AI 😀
In reply to Interesting. You were the… by Josh Mills
Well... nor sure an AI can do that, here's my NI attempt at it ;-)
Entirely untested ;-)
In reply to Well... nor sure an AI can… by Jojo-Schmitz
Thank you SO much for this! I tried running this in my Shortcuts Mac app but it didn't work. I hate to bother you, but is this relying on me to make a JSON file in addition? My assumption is that this would just get run as a shell script and it would do everything. I briefly looked at the code and didn't glean much from it. Sorry 😬
In reply to Thank you SO much for this!… by Josh Mills
That script does create the .json file
In reply to Thank you SO much for this!… by Josh Mills
Delete the line starting with 'rm' and post the json file here
And/or in the top line append a " -x" and post the output
In reply to Delete the line starting… by Jojo-Schmitz
I did the first step but did not see a JSON file in the Source folder.
I did the second step and got the same output as before I believe:
🔄 Exporting 8 files to MIDI and MusicXML...
Progress: 1/8 [12%]
Progress: 2/8 [25%]
Progress: 3/8 [37%]
Progress: 4/8 [50%]
Progress: 5/8 [62%]
Progress: 6/8 [75%]
Progress: 7/8 [87%]
Progress: 8/8 [100%]
✅ All done. Exported to: /Users/millsj1134/Desktop/Source
In reply to I did the first step but did… by Josh Mills
I don't think you did either.
The json file will be in your current directory
In reply to I don't think you did either. by Jojo-Schmitz
Yeah, I have been seeing that I think I did this wrong. I used ChatGPT and think I figured out how to do what you asked. Here's the JSON file. Note: it is exporting the full score MIDI and Full Score MusicXML, but I would like it to only export the "Piano" part for the MusicXML. Not sure if that is possible.
Sorry about my lack of knowledge. This is way out of my domain lol 😂 I appreciate your patience. Trying my best!
PS: is "NI" for "Natural Intelligence"? lol 😂 I realized that a way after initially reading that this morning. 😀😀
In reply to Yeah, I have been seeing… by Josh Mills
Yes "Natural Intelligence" ;-)
I did some fixes to that script above
That json doesn't look like being generated from that script, but in that form should work
In reply to Yes "Natural Intelligence" ;… by Jojo-Schmitz
Yes, now that I understand things a little better I made the changes to the script based solely off NI 😀
Here is that JSON file:
In reply to I don't think you did either. by Jojo-Schmitz
I found this GitHub issue: https://github.com/musescore/MuseScore/issues/22887
Seems like doing this for parts via CLI might not be supported :(
In reply to I found this GitHub issue:… by Josh Mills
Hold on, that's just for PDF and seems like it might work now. I guess maybe this is not supported for other formats such as MIDI/MusicXML?
In reply to Hold on, that's just for PDF… by Josh Mills
Not sure about the parts business
In reply to Not sure about the parts… by Jojo-Schmitz
Unfortunately I think that's what is causing the issue. The new updated code with your two modifications exports MIDI and MusicXML which is awesome (and shows I had human error 😬) but what I Really would love is the ability to choose which part gets exported for the MusicXML. I wonder if this would be beneficial for anyone else other than me? Could be in very edge case water here... hahahaha
In reply to Unfortunately I think that's… by Josh Mills
I believe this is supposed to work, but has bugs
In reply to I believe this is supposed… by Jojo-Schmitz
Do you know anyone that might be able to help me to get this to work possibly? If not, I completely understand. I have taken up a good amount of your time already.
In reply to Do you know anyone that… by Josh Mills
You found https://github.com/musescore/MuseScore/issues/22887
I believe there's a similar one for json
In reply to You found https://github.com… by Jojo-Schmitz
Thank you! I might have found it. I tagged you via GitHub. I sincerely appreciate your assistance. BTW: do you work for Musescore? 😀
In reply to Thank you! I might have… by Josh Mills
No, he does not. Nor do any of the regular posters here. We're all just users like you, trying to help each other out. :-)
In reply to No, he does not. Nor do any… by TheHutch
😀❤️
In reply to Thank you! I might have… by Josh Mills
No, I don't. Not in the sense of a paid employee at least
In reply to No, I don't. Not in the… by Jojo-Schmitz
Nice, well thanks for your help!! I really appreciate all you have done for me! 😀