MakeMusic
SmartMusic Finale Garritan MusicXML

Copy & Paste Contents

Moderator: Michael Good

Copy & Paste Contents

Postby Bryanation » Thu Oct 15, 2015 11:26 pm

Hi Michael,

I was wondering if I can just copy & paste MusicXML contents on Notepad++ and create a new file and save it as .xml. I already tried this but there seem to be errors that my application does not respond. Any ideas on what causes my app to crash?

Thanks!
Bryanation
 
Posts: 5
Joined: March, 2015
Reputation: 0

Re: Copy & Paste Contents

Postby Mogens Lundholm » Fri Oct 16, 2015 3:48 am

What app? Yes you may edit the MusicXML file. A problem that arise is
is the encoding of the file. The file may be Codepage, UTF8, UTF16 or UTF32.
Also the format may be big endian or little endian.

A dump of a MusicXML file:
00000000 3C 3F 78 6D 6C 20 76 65 72 73 69 6F 6E 3D 22 31 xml.version="1
00000010 2E 30 22 20 65 6E 63 6F 64 69 6E 67 3D 22 55 54 ".encoding="UT
00000020 46 2D 38 22 3F 3E 0A 3C 21 44 4F 43 54 59 50 45 8"?>.<!DOCTYPE

However loading the file in Notepad and saving as Unicode big endian:

00000000 FE FF 00 3C 00 3F 00 78 00 6D 00 6C 00 20 00 76 .<.?.x.m.l...v
00000010 00 65 00 72 00 73 00 69 00 6F 00 6E 00 3D 00 22 .r.s.i.o.n.=."
00000020 00 31 00 2E 00 30 00 22 00 20 00 65 00 6E 00 63 ...0."...e.n.c
00000030 00 6F 00 64 00 69 00 6E 00 67 00 3D 00 22 00 55 .d.i.n.g.=.".U
00000040 00 54 00 46 00 2D 00 38 00 22 00 3F 00 3E 00 0A .F.-.8.".?.>..

You see that two bytes are added to specify the format (Murphys law?)
Note that inside the file the format is also specified:
<?xml version="1.0" encoding="UTF-8"?> and now not corresponding to the
actual format.

Properly it is something else - it is not easy to make changed manually.
If you upload the resulting file then people in this forum may test and tell you
if the file works with Finale, Musescore and other programs.
A special program by Hans Vereyken can check the sanity of your MusicXml-file.

Kind regards
Mogens

PS: MusicXML should only allow one format! (Make it simple - UTF32)
Mogens Lundholm
 
Posts: 60
Joined: March, 2014
Reputation: 0

Re: Copy & Paste Contents

Postby Michael Good » Fri Oct 16, 2015 10:23 am

I find it a lot easier to do MusicXML testing in an XML-aware text editor that automatically handles XML syntax, Unicode encodings, and the like. oXygen Developer is a good cross-platform product and XMLSpy is good for Windows. Most of today's development environments also have XML support. One reason MusicXML was built on XML was to leverage all the XML software that's out there.
Michael Good
VP of MusicXML Technologies
MakeMusic, Inc.
User avatar
Michael Good
 
Posts: 2197
Joined: March, 2014
Reputation: 0

Re: Copy & Paste Contents

Postby Michael Cuthbert » Sun Oct 18, 2015 11:56 am

The problem of a disconnect between encoding specified in the <xml> header and the actual encoding is unfortunately a general XML problem and not something MusicXML can or should try to fix. There are lots of good detectors out there for various programming languages (music21 has its own for MusicXML because of the number of Sibelius "UTF-16" files floating around actually as UTF-8).

MusicXML already has a problem of its uncompressed format being too big. UTF-32 will make the problem 4x worse on average. And while a lot of software can make UTF-16 basically readable, support for UTF-32 is much lower. Given the very high percentage of musicxml data that is purely ASCII, I'd encourage using UTF-8 for most encoding projects.
Michael Cuthbert
 
Posts: 70
Joined: March, 2014
Reputation: 0

Who is online

Users browsing this forum: No registered users and 2 guests

cron