< Back to IRCAM Forum

Include midi channel data in export-musicxml?

Hi. Wondered if there’s any easy way to have midi channel data remain in tact when I’m exporting a Poly to XML (I do have the latest fix ( export-mxml-new-vers18opt) . Examining an exported XML file shows all voices defaulting to midi channel 1. Thanks!

Hello — you’re right MIDI info is not considered at the moment in MusicXML export.
As far as I know music XML does not have a MIDI attribute for the “note” element, but the format allows to specify an “instrument” for the note (and I think the instrument can be attached to a MIDI channel). So there’s probably something to do about it. I’ll keep you posted.
Jean

Good to know, and thank you.

Could you try to open the attached XML file (poly.xml) ?

I would expect it to have four notes on four different MIDI channels (attached picture).
Unfortunately I don’t have a music notation software at hand to test it myself.

Also, could you provide an XML file exported by your notation software with different MIDI channels ?

Thank you
Jean

Capture-d’écran-2018-07-30-à-16.30.41.png

Thanks, Jean. When I import your attached poly directly into OM, the midi channel data you show on your screen capture is not preserved. All notes are on channel 1.
It looks like midi channel data is not preserved either when I create a doc in Finale and export to xml, so maybe this is trickier than I had thought. I am able to preserve midi data in either direction when simply exporting as a midi file, though.

Jeans-poly-imported-and-re-exported.xml (1.86 KB)

When I import your attached poly directly into OM, the midi channel data you show on your screen capture is not preserved. All notes are on channel 1.

I know. OM does not read MIDI channels in XML.
I would like to know if other notation software can read them in this XML file (poly.xml).

Ah, got it, sorry about that. I don’t know how to get Finale to distinguish different midi channels within one track or staff. I’m curious though, could you send another poly with different midi channels in separate staves? The musicxml file that I created in Finale, in that format, kept the midi channel information preserved when I re-imported it into Finale (attached)

(attatchment)

my-file-from-finale.xml (9.41 KB)

your attachement is still missing. probably the file extension not accepted by this Forum: if this is it I think you can just zip it for instance.

… and here is an exported poly with 4 separate voices (one MIDI channel each)

Capture-d’écran-2018-07-31-à-08.14.09.png

Thanks Jean. I renamed attachment extensions and they seemed to have uploaded now (above), and yes your 4-voice poly was able to be successfully imported into Finale with midi channel data preserved! (screenshot here)

finale-import-4-vx.png

ok. so, I hope this strategy will work for now :slight_smile:
=> It is now in-built in the MusicXML import/export functions of OM 6.14
http://forumnet.ircam.fr/shop/fr/forumnet/43-openmusic.html
Let me now if it works.

Best regards,
Jean

Jean, thanks so much for including midi channel support for xml export. Wanted to ask: in the latest release, I’m once again seeing rhythm issues in tuplet rendering in xml export (see attached). I can get around it by putting Karim’s “export-mxml-new-vers18opt.lisp” patch from 2016 in my user folder, but then it removes the nice midi channel capability that you so kindly added. Is there an easy way to have both?
regards,
Leonard

Dear Leonard,
You’re right: this patch from Karim/2016 is not fully compatible with current XML export, which has slightly changed in the meantime (with MIDI channel support, text, and a few other things). I should see with Karim how to put this all together and commit it nicely inside the core OM source.
We’ll let you know.
Jean

ps. could you also attach the original POLY in an OM patch ?
Thank you
Jean

Dear Leonard,

Sorry for the late reply. I will take a look on this issue and see if it is not too much of a hassle to fix since i was out of the dev loop concerning musicxml. I don’t use this anymore since it is really complicated to have musicxml compatibility with 3rd party engravers and since my workstation is mainly on linux, i use lilypond. However i will give it a shot.
Just one question, what are you using as an engraver ? sibelius, Finale or musescore ?

Best
K

Hi Jean and Karim. I’ll attach a workspace. (different Poly than prior post but same kinds of artifacts) Let me know if you can’t open. My own library and Karim’s xml fix for the older release are in the user folder. Karim, I use Finale 26 for notation. Thanks again!
best,
Leonard

my-ws.rar (676 KB)

Dear Leonard,

Here is an updated file of my code integrating the midi channels by voice. Unfortunately i couldn’t modify Jean’s default OM file, since, if i should fix the tuplets there i must go through all the code. So for the time being it’s the file you will be using (in attachment). Don’t forget to remove my old code and put this one instead.

However, be advised:

  1. Midi channels doen’t work as it should be in musescore. In Finale it’s ok (i think ?)
  2. You will get warnings while importing the xml in Finale. Just ignore them. I integrated Jean’s hack and i think we are not yet there.

This is the problem with musicxml. It doesn’t work universaly well from engraver to engraver, and the reason i don’ tuse this export anymore.
However i will be working also to include dynamics. I will soon send another code for that.

BEst

K
PS: don’t hesitate if you find something fishy. Will look into it then.

export-mxml-new-vers19opt.lisp (75.3 KB)

Thank you for all of the work on this, Karim. I get this error message when trying to use export-musicxml with the new fix. Any ideas?
best,
Leonard

error.jpg

Sorry man,

My bad. Please trash the former one and use this (vers 20). It is supposed to be fixed.
I also included vers 21 which supports dynamics.
You should use only one of these. Start testing on 20, and if you like move to 21 (which is beta).

Best
K

export-mxml-new-vers20opt.lisp (75.4 KB)