Piano Rendered as Percussion/Drums when Importing MIDI
I would like to save a song in MIDI format from my Yamaha DGX-650 keyboard and import it into musescore. When I import the MIDI file into musescore it is imported as percussion, rather than piano.
How can I get it to import properly as piano?
Attachment | Size |
---|---|
UserSong5.MID | 1.71 KB |
screenshot.png | 60.87 KB |
UserSong5.mscz | 8 KB |
Comments
I don't know much about such things, but from what I can tell, there is special code in MsueScore to try to recognize some sort of Yamaha-specific information to guess if a MIDI file is meant for drums, and for whatever reason, this particular MIDI file is triggering that code. Something to do with "part mode". If you can find a setting like that on your keyboard, make sure it is set to 0.
In reply to I don't know much about such by Marc Sabatella
It's my guess that it is the chunk of SysEx at the beginning of the file that is causing the trouble.
Obviously MuseScore is not interpreting it right.
The section of it which sets part mode is as follows - all is hexadecimal:
For those interested - the interpretation of this hexadecimal is as follows.....
The first four bytes F0 43 10 4C are the SysEx Status byte followed By Yamaha's identification stuff, which is why it is the same in each string.
The next 4 bytes do the business....
08 references the XG PARAMETER CHANGE TABLE ( MULTI PART ) the next byte is the channel, the third byte in the chunk is the particular parameter being changed - in this case part mode - the final byte of this chunk sets the part mode then you have the SysEx "End" Status byte.
As you can see the only channel which has part mode set to anything other than 0 (normal) is channel 10 (0x09) which has it set to 2 (Drums 1).
The only channel MuseScore should be interpreting as a Drum Channel is channel 10, but somehow it is applying the partmode message to channel 1 as well.
Presumably whoever coded this didn't understand Yamaha SysEx as well as they thought they did :)
The temporary solution is to use a sequencer to remove the SysEx from the file (which is irrelevant to MuseScore anyway) and re-import it.
PS Indeed that is the solution - MIDI attached :)
In reply to It's my guess that it is the by ChurchOrganist
@ChurchOrganist...
Maybe same SysEx issue here? See:
https://musescore.org/en/node/76681
Piano score was rendered as percussion, but repaired(?) from within MuseScore.
Regards.
In reply to @ChurchOrganist... Maybe same by Jm6stringer
Yes indeed - similar chunk of Yamaha SysEx at the beginning of the file.
When I have time I will raise this in the issue tracker unless someone else feels able to do it.
In reply to I don't know much about such by Marc Sabatella
How can I delete the SysEx data? Is there an open-source tool for this?
In reply to How can I delete the SysEx by deklin
You should be able to do it in any MIDI sequencer. Sadly most of the Open Source solutions are on the Linux Platform.
There are a couple of freeware solutions which may help you if you're on Windows.
There is a list here which also includes scorewriting and DAW for some reason...
https://en.wikipedia.org/wiki/Comparison_of_MIDI_editors_and_sequencers
In reply to I don't know much about such by Marc Sabatella
Wow - who knew??? Thanks for looking at this. I confess this goes beyond my technical expertise. There was enough info in the corrupt version to modify and reharmonize so that I have a decent score.
In reply to Wow - who knew??? Thanks for by stewartb132
Thanks for the help! I created a PHP script based on the information provided by ChurchOrganist. The script targets and replaces the SysEx data which is responsible for this, creating a new file without the issue.
{syntaxhighlighter SPEC}<?php
$data = bin2hex(file_get_contents('song.mid'));
$data = preg_replace('/7e..f700/','7e00f700' ,$data);
$data = preg_replace('/00..f700/','0000f700' ,$data);
$data = preg_replace('/07..f700/','0700f700' ,$data);
file_put_contents('song-fixed.mid', pack("H*" , $data) );
echo 'Done!';
?>{/syntaxhighlighter}
In reply to Wow - who knew??? Thanks for by stewartb132
As soon as Marc mentioned Yamaha Part Mode I knew this one was part of my remit - in a prior existence as a backing track programmer I was working with Yamaha XG SysEx on a daily basis.
It's not rocket science once you know where to look in the data tables which Yamaha always provide with their keyboards and sound modules.
Took me ten minutes once I'd downloaded the DGX-650 data lists to isolate the problem.
Took me longer to write the post explaining the problem - lol
Issue #85856: Piano renders as percussion on SMF import with Yamaha XG SysEx block opened in the issue tracker