musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
12.39k stars 2.68k forks source link

Export to musicxml changes midi id 46 (hi-hat) to 47 #20283

Open bernsamr opened 1 year ago

bernsamr commented 1 year ago

Issue type

Import/export issue

Bug description

3674570.mscz.gz

Steps to reproduce

Export attached mscz file to musicxml format Afterwards load exported file Compare drumset hi-hat between the two files -> it is different in the exported file (id 47)

(As proof I also edited the exported musicxml file and replaced notes with id 47 per id 46 there. Then loaded it and it did behave like the original file again)

Screenshots/Screen recordings

No response

MuseScore Version

OS: macOS 14.1, Arch.: arm64, MuseScore version (64-bit): 4.3.0-, revision: github-musescore-musescore-

Regression

No.

Operating system

macOS 14.1.2

Additional context

No response

zacjansheski commented 1 year ago

It looks like this has been an issue since 4.0.0 My workaround for this is to add a new drumset instrument and copy and paste the imported part on the new drumset part. In this case I imagine you will want to update the noteheads as well.

These import wrong: Low Tom - MIDI 45 Open Hi-Hat - MIDI 46 Low-Mid Tom - MIDI 47 Crash Cymbal 2 - MIDI 57 Ride Cymbal 2 - MIDI 59

zacjansheski commented 1 year ago

Also, oddly enough, if you save and reopen the file, the sounds will be correct.

rettinghaus commented 11 months ago

It seems that this is no bug but in the specification of MusicXML:

https://www.w3.org/2021/06/musicxml40/musicxml-reference/elements/midi-unpitched/

The MIDI program number of the hi hat is 46, but MusicXML stores those as one-based numbers, so 46 reads 47 in MusicXML. That's why after the reopening the sounds still are correct.

Jojo-Schmitz commented 11 months ago

The fact that you have to save, close and reopen to make it sound correct though does indeed indicate a bug, just none in the MusicXML export though and maybe not in MusicXML import either.

3.x does import it correctly the first time (i.e. no need to save, close, reopen), so defintly not a MusicXML export issue. But indeed a Mu3 regression

bluebear94 commented 7 months ago

Exporting the drumset from the opened MusicXML score gives the intended pitch, too:

  <Drum pitch="46">
    <head>cross</head>
    <line>-1</line>
    <voice>0</voice>
    <name>Open Hi-Hat</name>
    <stem>1</stem>
    </Drum>