BandInMuseScore icon indicating copy to clipboard operation
BandInMuseScore copied to clipboard

Issue with cmd command and XML files

Open Yazakk opened this issue 3 years ago • 2 comments

First Issue: Using mscz files provided in example folder

When I am running the plugin through command prompt, I am using the following:

mma.bat -i BandInMuseScore.mscz

And this is what I am getting.

C:\WPython64\mma-bin-20.12>cd C:\WPython64\mma-bin-20.12\

C:\WPython64\mma-bin-20.12>..\PYTHON~1.AMD\python.exe mma.py -i BandInMuseScore.mscz Traceback (most recent call last): File "mma.py", line 91, in import MMA.main File "C:\WPython64\mma-bin-20.12\MMA\main.py", line 92, in MMA.paths.readRC() File "C:\WPython64\mma-bin-20.12\MMA\paths.py", line 155, in readRC MMA.parse.parseFile(f) File "C:\WPython64\mma-bin-20.12\MMA\parse.py", line 94, in parseFile f = MMA.file.ReadFile(n) File "C:\WPython64\mma-bin-20.12\MMA\file.py", line 144, in init l = inpath.readline() File "C:\WPython64\PYTHON~1.AMD\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 117: character maps to

When I use MuseScore software, everything works fine for the mscz files in your example folder.

So my first question would be, how can I use cmd to generate the mma and MIDI files?

Second Issue: Using my files

I downloaded the following file

This is the message I am getting when I am using the plugin from MuseScore software:

_MMA accompaniment is ready for you, but we could not generate the MIDI file from it. Please fix the following error:

C:\Program Files\MuseScore 3\bin>cd C:\WPython64\mma-bin-19.08\

C:\WPython64\mma-bin-19.08>..\PYTHON~1.AMD\python.exe mma.py -f C:/Users/YAZAN/AppData/Local/Temp/Nocturne_No.1_Op.2_MMA.mid C:/Users/YAZAN/AppData/Local/Temp/Nocturne_No.1_Op.2_MMA.mma
Error: <Line 10> File:C:/Users/YAZAN/AppData/Local/Temp/Nocturne_No.1_Op.2_MMA.mma Illegal/Unknown chord name: 'Legato'

The generated MMA file is nevertheless available at "C:/Users/YAZAN/AppData/Local/Temp/Nocturne_No.1_Op.2_MMA.mma"_

And this file , for example, is giving this error:

_MMA accompaniment is ready for you, but we could not generate the MIDI file from it. Please fix the following error:

C:\Program Files\MuseScore 3\bin>cd C:\WPython64\mma-bin-19.08\

C:\WPython64\mma-bin-19.08>..\PYTHON~1.AMD\python.exe mma.py -f C:/Users/YAZAN/AppData/Local/Temp/Fr_Elise_MMA.mid C:/Users/YAZAN/AppData/Local/Temp/Fr_Elise_MMA.mma
Error: <Line 21> File:C:/Users/YAZAN/AppData/Local/Temp/Fr_Elise_MMA.mma Repeatend/EndRepeat without Repeat

The generated MMA file is nevertheless available at "C:/Users/YAZAN/AppData/Local/Temp/Fr_Elise_MMA.mma"_

The files I need to work on mainly are musicxml files, and each file gives me a different error when I want to apply the plugin on MuseScore. So I attached two files in a zip file.

musicxml_files.zip

I want to know why can't I use these files.

Yazakk avatar May 31 '21 11:05 Yazakk

Hello @Yazakk

Thanks for the feedback.

Your first issue: the plugin does not run from command line, only from MuseScore, to transform the chords and MMA annotations in your score in a .mma file.

This .mma file is then turned into a .mid (rich accompaniment) file (that is the purpose of the mma.bat file you tried to use), and then the generated .mid is opened back in MuseScore.

For the next issues: none of the files you used (Nocturne_No.1_Op.2 and Für_Elise) have chords... so there would be nothing for the plugin to generate accompaniment from. You need at least one chord at the beginning, or an MMA annotation mentioning the tune of the piece.

Aside from that, the end of the error messages you got are explicitly telling you the problem:

  • Nocturne_No.1_Op.2_MMA.mma: Illegal/Unknown chord name: 'Legato' ... there is a text box (annotation) with the text "Legato" that has been written in a Harmony (chord) annotation. You can change it's type from the element properties, and I'll look at narrowing down the types of annotations that the plugin considers to be MMA annotations, as it seems there are new possibilities in the last API versions of MuseScore.
  • Fr_Elise_MMA.mma: Repeatend/EndRepeat without Repeat ... MMA needs to know explicitly where a repeat bar should repeat to. I didn't handle the (common) case of a single repeat end bar without a repeat opening bar (by default at the beginning of the piece) yet. If you want to have a look at the code and improve please do ! Maybe putting a default "Repeat" command at the beginning of all songs works, cancelling it out with a "RepeatEnd 1" at the end if I understand correctly the MMA documentation at https://www.mellowood.ca/mma/online-docs/html/ref/node20.html.

Kindly let me know if you do something about it in the plugin !

berteh avatar Jun 15 '21 18:06 berteh

Did you manage to get it to run for you ?

berteh avatar Oct 28 '21 23:10 berteh