I work with music material generated by pthon programs.
Currently I’m using a python library called Scamp to write musicxml for me.
I have one small example of a python-scamp.xml file and the output from Dorico
and Musecore to show you. Musescore is doing better.
Another example is from a python-scamp.xml file
interpreted by Sibelius and exported as a xml file. Dorico gives
better output from the Sibelius converted file than the Python-Scamp file.
The examples is about 3:2 tuplets.
I don’t know how to send the files to you.
Is there something to be done in Dorico to make it perform better?
Post it here. You may need to zip it first.
Wow! Thank You!
I’m a bit embarrassed for not doing the obvious thing first.
The second example is a bit messy and to big but if you look
at the first ten bars you will hopefully see what I mean.
ex1_dorico.pdf (26.6 KB)
ex1_muscore.pdf (28.8 KB)
ex_1.xml (7.9 KB)
dorico.pdf (79.9 KB)
from_sibelius.xml (317.2 KB)
original.xml (156.1 KB)
Sibelius.pdf (39.1 KB)
I downloaded Musescore and imported example 2 and
exported it as an musicxml file. The Musescoreconverted
musicxmlfile looks better in Dorico than the original file.
So the workaround for me is to take the .xml file generated
by my Python-Scamp program import it to Musescore export
it from Musescore and use that file i Dorico. A bit cumbersome
i think.
I hope there is a better solution.
Otherwise I’m on Linux and would love to see Dorico at home
instead on Windows 10, hint, hint
musescore.xml (218.3 KB)
Maybe for a quick test, use PIP to install music21… Not sure how you are creating the XML originally in Scamp - but at worst with a couple of extra python lines to test it something like:
import music21 as m21
tempscore = m21.converter.parse(insert Your original XML file or text)
tempscore.show(“MusicXML”)
That way, if you like the music21 output better, at least it ends up being no extra work for you, just a slightly longer script.
I don’t use it a lot, but its handy for things like importing a traditional tune that was captured in ABC or something - the converter can parse a lot of stuff.
Keep or sweep man.
Thank You!
I will try that. I use music21 for importing midi files and xml files and
use them in my Python programs. Mostly under Linux. For output i found it easier to use Scamp. (I’m no expert but stumbled over that solution to the programs i write for the moment).
Importing a scamp.xml to music.21 seems odd but i think your right and it
will work. I the mean time I found that you can start Musescore from the commandline, import a xml file and output a new xml file that Dorico understands. Very handy under Linux. Under Windows 10 i had to learn/guess a bit (unfamilar with directories/maps and filhanling … phu or puh or pooh as Winnie would say ).
So, for now i write out a scamp.xml load it in Musescore save a musescore.xml
wait 3 seconds and fire up Dorico with the musescore.xml all in an odd python hack that, fingers crossed, seems to work.
Lets se if it works tomorrow
Thank You again. I will look into the music21 solution. See if i can make it
work under Windows. Good idéa.
I think the problem with ex_1.xml
is that you need to set the <tuplet-normal>
and <tuplet-actual>
values for the tuplet. You’ve set <time-modification>
which gives the ratio for the tuplet, but Dorico also needs to know the unit of the tuplet.
Have a look at an example like this one: MusicXML example: <tuplet-dot> | MusicXML 4.0
OK! Thank You.
For the moment I don’t have time to dive into writing musicxml directly. I rely on python libraies for that. For the examples i used
scamp from python.
I guess there are different ways, some more correct, to write the xml code. For me today I have to stick with the Musescore converting the files.
Thank you for letting me know.
If you are a scamp user then you will no doubt have watched the tutorial on Generating Music Notation, in which the observation is made that “… every notation program [both creates and interprets] xml differently… and all appear to make errors!”
My experience has been that different programs have different shortcomings, but Dorico is particularly sensitive to how tuplets are configured.