Group Admins

  • Profile picture of Karim
  • Profile picture of Jean

OpenMusic

Public Group active 1 hour, 31 minutes ago

User group for OpenMusic and computer-aided composition. Visit the Forum for discussions.

Include midi channel data in export-musicxml?

Author 3 Subscribed Users |
Profile photo of lt72music
lt72music

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!

July 8, 2018 at 21:15 #27093
Profile photo of Jean
Jean

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

July 22, 2018 at 09:13 #27211
Profile photo of lt72music
lt72music

Good to know, and thank you.

July 22, 2018 at 17:42 #27215
Profile photo of Jean
Jean

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

Attachments:
  1. Capture-d’écran-2018-07-30-à-16.30.41

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

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

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

  1. poly.xml
  2. poly.xml
July 30, 2018 at 15:31 #27306
Profile photo of lt72music
lt72music

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.

July 30, 2018 at 18:06 #27313
Profile photo of Jean
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.

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).

July 30, 2018 at 22:12 #27321
Profile photo of lt72music
lt72music

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)

  • This reply was modified 5 months, 3 weeks ago by Profile photo of lt72music lt72music.
July 31, 2018 at 01:21 #27331
Profile photo of lt72music
lt72music

(attatchment)

  • This reply was modified 5 months, 3 weeks ago by Profile photo of lt72music lt72music.
July 31, 2018 at 01:30 #27333
Profile photo of Jean
Jean

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.

July 31, 2018 at 07:12 #27337
Profile photo of Jean
Jean

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

Attachments:
  1. Capture-d’écran-2018-07-31-à-08.14.09

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

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

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

  1. poly-4voices.xml
  2. poly-4voices.xml
July 31, 2018 at 07:21 #27338
Profile photo of lt72music
lt72music

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)

Attachments:
  1. finale-import-4-vx

    finale-import-4-vx.png

July 31, 2018 at 12:15 #27346
Profile photo of Jean
Jean

ok. so, I hope this strategy will work for now :)
=> 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

August 28, 2018 at 10:10 #27547
Profile photo of lt72music
lt72music

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

  • This reply was modified 1 month ago by Profile photo of lt72music lt72music.
December 22, 2018 at 19:17 #28640
Profile photo of Jean
Jean

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

December 26, 2018 at 00:25 #28654
Profile photo of Jean
Jean

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

December 26, 2018 at 00:47 #28655
Profile photo of Karim
Karim

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

December 26, 2018 at 12:29 #28659
Profile photo of lt72music
lt72music

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

  • This reply was modified 3 weeks, 5 days ago by Profile photo of lt72music lt72music.
Attachments:
  1. my-ws.rar
December 28, 2018 at 21:43 #28667
Profile photo of Karim
Karim

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.

January 4, 2019 at 20:10 #28727
Profile photo of lt72music
lt72music

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

Attachments:
  1. error

    error.jpg

  2. error

    error.jpg

January 6, 2019 at 07:33 #28731
Profile photo of Karim
Karim

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

January 6, 2019 at 13:04 #28734
Profile photo of lt72music
lt72music

Thanks very much Karim. Midi channel data and tuplet rendering both work well….much appreciated!
best,
Leonard

Attachments:
  1. vers20

    vers20.jpg

January 6, 2019 at 19:35 #28739
Profile photo of Jean
Jean

Hi Leonard. If you have a chance, could you provide both the poly (just a poly in a simple OM patch) AND the generated XML files (with/without Karim’s fix) ?

In other word, either the XML files exported from your attached example, or the POLY corresponding to your previous XML files.

I am trying to fix your problem in the OM base code, which will be better that relying on separate fix each time you will update something.

Thank you
Jean

January 13, 2019 at 14:09 #28834
Profile photo of Jean
Jean

… or you can directly try with this file, to use instead of Karim’s last file (don’t keep both of them, and restart OM when you change it).

This is a “blind” fix (not tested). Let me know if it works :)

Thank you
—Jean

January 13, 2019 at 14:40 #28836
Profile photo of lt72music
lt72music

Hi Jean, looks like Karim’s version 21 fix is still the best so far, as it doesn’t produce errors in tuplets. Let me know if you need a different poly or xmls …Thanks!

Attachments:
  1. xml-tests.rar
January 13, 2019 at 18:44 #28844
Profile photo of Jean
Jean

ok — here is another try
please replace the previous one.

January 13, 2019 at 22:40 #28848
Profile photo of lt72music
lt72music

Lokks good, Jean…thank you!
best,
Leonard

January 14, 2019 at 16:54 #28866
Profile photo of lt72music
lt72music

Jean,
Sorry, I jumped the gun. Your export-mxml-2 fix produces this error with the attached poly. Karim’s vers21 still works well though.
best,
Leonard

Attachments:
  1. error-with-export-mxml-2

    error-with-export-mxml-2.png

  1. single-poly-2.omp
January 18, 2019 at 04:20 #28876
Profile photo of Jean
Jean

Sorry — here is a fix for that, too !

January 18, 2019 at 10:07 #28881
Profile photo of lt72music
lt72music

That did the trick. Thanks much Jean.

January 18, 2019 at 19:03 #28894

You must be logged in to reply to this topic.

Log in now