MIDI Import GM Instrument Detection Error

• Apr 22, 2016 - 17:11
Reported version
3.0
Type
Functional
Severity
S4 - Minor
Status
closed
Project

Version 2.0.2 Revision-f51dc11 Linux 64bit -- UbuntuStudio JACK. Soundfont FluidR3Mono_GM.sf3

When opening a MIDI file with multiple tracks any (out of the six or so I tested) instrument that follows a Piano track will also be classified as a Piano. If the Piano track is last in the sequence of tracks, all is well.

Other instruments do not show this behavior.

I tested General MIDI #s: 25, 26, 73, 74, 76, 27, 28,33,34, 35, 41,42,43,58,68 & 67.
With six or seven tracks it doesn't matter which instrument follows a Piano (1 or 2) or where in the order it is. It is always listed in the MIDI Import Panel with the Sound as a Piano. The Staff Name is the correct name from the track in the MIDI file.


Comments

Status (old) active needs info

I tried reproducing this in 2.0.3 with a simpel example exported from MuseScore and it worked fine. So I'm guessing it is something very specific to the MIDI files in question - probably something about how the program that created them structures them. Either that or a bug in 2.0.2 that has already been fixed - you might try updating (2.0.3 is available for all Linux distributions via the Downloads link in menu at right).

In any case, it's easy enough to copy and paste the content to new staves as necessary if something about the staff configuration in a MIDI file confuses MuseScore, so I'm resetting the priority to "normal".

Status (old) needs info active

Attached are 2 MIDI files one ( issue_107701-bad.mid ) exhibits the broken behavior and one ( issue_107701-ok.mid ) shows the same instruments just in a different track sequence.

The attached PNG files show the MIDI Import panel results for each file.
issue_107701-bad.mid and issue_107701-ok.mid
The other screenshot shows the results of importing the same 'bad' file into Ardour
issue_107701-bad-ardour-ok.png

If you need more MIDI samples let me know which instruments in which order you would like them. I can easily generate whatever you need.

It appears from what I see after import that the the bass track is set to the same MIDI channel as the piano track. That's either another symptom of the problem, or it is the *cause*...

In this example the Bass track is set to the Piano. As mentioned in the original post, ANY instrument that comes after a Piano track is set to Piano. So it isn't an issue with the Bass.

Well, after import, *all three* tracks show channel 1. Like I said, that's either another symptom of the problem, or it's the cause. That is, if the file itself actually has all tracks transmitting on the same channel, that's unusual and not recommend as far as I know (even if it can technically be made to work), and if that is something you do regularly, that probably that is why your MIDI files often have this issue but other people's don't. What program created these files? Can you check to see if the different tracks are indeed all set to transmit on the same MIDI channel?

If so, then my guess is that this is by design - probably MuseScore is deliberately looking for adjacent tracks using the same MIDI channel and assigning them both to the same instrument if so. Seems I remember this being implemented at some point. But trig-ger would know better than I!

So I'm guessing it is something very specific to the MIDI files in question - probably something about how the program that created them structures them.

The files import into Ardour and QTractor correctly. The tool I generate them with uses the ( https://mido.readthedocs.org/en/latest/index.html ) MIDO Python library to write the tracks into the file. It seems pretty stable and other tools do not exhibit this behavior with the Piano track.

Either that or a bug in 2.0.2 that has already been fixed - you might try updating (2.0.3 is available for all Linux distributions via the Downloads link in menu at right).

I haven't found a 2.0.3 for Ubuntu. Not in the Ubuntu Software Center or in the PPA on Launchpad. If you know where there is a binary I would like to install it.

Okay. This may be the issue then. I will send each track to a different channel. But why only the Piano does it? We'll see if it fixes the problem.

Status (old) active closed

Okay, Setting each track to use a different channel does solve the problem.
Apparently I was confused about how MIDI channels and tracks are related.

I didn't know about AppImages. How cool is that?! Except on UbuntuStudio I do not seem to have Transport control. The controls are greyed out.