xylucien / MusicalKits_Converter

My personal Flask project
1 stars 0 forks source link

Music21 musicxml.png cannot output to certain folder #84

Closed xylucien closed 4 years ago

xylucien commented 4 years ago

Here is a really annoying bug that I found when running locally: Score.write() works well on every single other format, but when it comes to musicxml.png it returns

convert </home/lucien/MusicXML2ABCNotationWebApp/tests/a>...
Cannot read file /home/lucien/MusicXML2ABCNotationWebApp/tests/a:
unknown type
xylucien commented 4 years ago

the code i use is b = converter.parse('tests/ActorPreludeSample.musicxml').write('musicxml.png', 'tests/a') Obvoiusly, tests/a should be the output folder (again, this works on every single other format), but here it fails

xylucien commented 4 years ago

dont know if it's because im somehow using outdated version of music21, which also causes #74

xylucien commented 4 years ago

I think I should use the master branch music21 for this. How could I do that?

xicheng87 commented 4 years ago

Do we understand why this is happening? Is this a known issue to music21?

Like I said before, there is risk if we manually downloading the master branch and compile, I am still inclined to a release version.

Further, can we get around this, or are you saying writing to png always fails?

xylucien commented 4 years ago

Yes I can get around this, but that means I cannot specify the location of the pngs generated. They will be stored under /tmp/music21/

xylucien commented 4 years ago

the thing is that musescore will produce multiple pngs when necessary, and I want to have them packed into a zip file for download. Having these images stored under the app folder will make this much easier, but now it seems like I have to process from /tmp/music21/

xicheng87 commented 4 years ago

Thanks for clarifying, let's file a bug for this, describing the issues, and get around this for now. In your changes, refer to this bug and add comments so later you / I won't get confused.

The step I'd like to suggest is that you add sufficient testing for this workaround (processing things in /tmp/music21), making sure it works correctly. Tests are really important for us at this stage as things are getting more involved.

xylucien commented 4 years ago

Because I can get files from the tmp folder, this shouldn't be a problem for our project