It doesn’t matter what name I use for the xml file: I always get the error message: name.musicxml doesn’t exist.
e.g. transform -xsl:mxml-pitches.xsl myfile.musicxml >myfile-new.xml
myfile.musicxml doesn’t exist.
Maybe I misunderstand something. I have installed Saxon and I then type your code with the name of my xml file in the command line, nothing happens. Or I open the command window and this is the result:
C:\Users\myname>transform -xsl:mxml-pitches.xsl myscore.musicxml >myscore-new.xml
Source file myscore.musicxml does not exist
I started working with macros. This could be a solution. But the problem is that notes in a chord are not shown in the correct order like in the attached pic of Martin90. If I start with “D” this will be the highest name and the other names appear in order of input below “D”.
So I try to understand the suggestion of Martin90.
Yes this is a potential downside. There is an easy enough fix though - in engrave mode you can select the “tucking index” and this will control which playing technique appears higher vertically if there are two.
Sorry, I forgot to mention that the MusicXML file must be located in the same directory as the XSLT file. Otherwise the transform command stated above doesn’t find the file.
Alternatively, you can of course also prefix the filename with the path to the file, e.g.
If you are unfamiliar with the command line, you use the “cd” command to change directory to a different folder. By default you’re just in the “C:\Users\whateveryournameis” folder and that’s probably not where the musicxml file is and is probably not where the stylesheet is. So if you use the cd command to change directory to the folder that has your MusicXML and stylesheet file in it, you can just use the filenames in the command instead of the full path.
As a trick in Windows you can also go into the folder in Windows Explorer and right-click “Open Command Prompt Here”, and that will open a command prompt already in the correct folder. But using the"cd" command works too.
The files were always at the same directory. I now put them in different folders (both always in the same folder) used also the path. Sometimes I get a file most of the the time no file is created.
And every created file is empty (0 bytes)
I stopp for tonight and say thank you to Martin90 and mducharme.
Nice work, Martin! For English note names it would be better to use the Unicode ♭ and ♯ symbols if possible, rather than b and #. And I note that Patrik’s OP in the original thread shows German note names.
Thank you for the feedback, Mark. These things are easy to fix.
I’ve replaced the characters for the accidentals and added an optional parameter locale to select the language of the note names. locale=de switches to German.
Yes, sorry. I noticed that Saxon always tries to retrieve the DTD given at the beginning of the MusicXML file. Because there’s no option to turn this off, you need to remove the first line from the file (or provide a local copy of the DTD which is more difficult to set up).
I installed saxon also on my Mac (had to install also Xcode )and entered the command in the terminal butget the following error: zsh: command not found: transform