problems importing midi files

Having trouble with LMMS? Ask about it here.
Hi

I am new to LMMS and currently want to use it (mostly) play midi files, and record from and play to connected midi instruments.

When I import midi files (which are usually set up for several instruments/tracks, or sometimes one instrument with double stave like a piano or synthesiser) very frequently notes are skipped. I can't spot any pattern to *which* notes are skipped, often ones at the beginning, but not always.

This seems easily reproducible, and happens very frequently. I produce my midi files with musescore 2.0.2 on Ubuntu 15.10 and save them with file>export in musescore. A sample is at http://mat140.bham.ac.uk/testimport.mid This contains an ascending G major scale. When imported into LMMS (1.1.3) the first two notes are skipped, though an empty bar where they should be is "imported"...

Any ideas?

Many thanks
Richard
rwkaye wrote:Hi
When I import midi files (which are usually set up for several instruments/tracks, or sometimes one instrument with double stave like a piano or synthesiser) very frequently notes are skipped. I can't spot any pattern to *which* notes are skipped, often ones at the beginning, but not always.
Too short notes were being skipped in the past, IIRC. Some improvements have been made in that area and the changes are available in the git version or in the upcoming LMMS 1.2.
rwkaye wrote: A sample is at http://mat140.bham.ac.uk/testimport.mid This contains an ascending G major scale. When imported into LMMS (1.1.3) the first two notes are skipped, though an empty bar where they should be is "imported"...
OK, the current git version isn't much better here. It doesn't import the 2 first notes, and not even an empty bar. But, I had a look at that midi file using hachoir (sudo apt-get install python-hachoir-wx should do it) and it only recognized the first "note on" event (a G), the rest of the data was displayed as raw bytes and not recognized as midi commands. To get a third opinion, I tried timidity, that complained "Last 2 MIDI events are ignored" and didn't play a single note. With this evidence, I lean towards your file not being entirely correct. (Edit: ...or using some more rarely supported midi feature.)
I found a solution :)

Press following keyboard shortcuts in the piano roll:
<CTRL>+<A> (select all notes)
<CTRL>+<Right Arrow> (shifting selected notes one bar forward)

i guess the file is 'corrupted' or lmms mis-read the file in a such way that the notes are aligned into a wrong position.
bokuyata wrote: i guess the file is 'corrupted' or lmms mis-read the file in a such way that the notes are aligned into a wrong position.
I'll be damned. Looks like a bit of a puzzle to dig into.
Many thanks!

These look like useful workarounds, and I will have to experiment. I confirm that I can get the other notes with ctrl-arrow. Unfortunately this also requires that I know *where* the missing notes are, and as I prefer to import several bars at a time in what is possibly quite a long midi file, there may be quite a lot of manual tweaking to do. It also doesn't quite sort out the issue of the import starting in unexpected places, e.g. bar 2 when a bar's worth of notes are skipped.

I have no time to check whether the midi files I am using conform to the standards or not. One day I might investigate this... I can confirm that I can import the midi correctly into other applications.
rwkaye wrote:Hi I am new to LMMS and
Welcome to the forum rwkaye! First, For you all important links:
http://lmms.io/forum/viewtopic.php?f=1&t=4740

That notes are 'outside left egde' is actually interesting!
Could you try the following:

On a fresh new start of lmms
*Open pianoroll
Image

* change Q to 1/192
Image

* reimport the midi-file

what happens now?
rwkaye wrote:Many thanks!
I have no time to check whether the midi files I am using conform to the standards or not. One day I might investigate this... I can confirm that I can import the midi correctly into other applications.
I had a closer look at the bytes in the file, and it looks like running status(*) is used. That could explain why both hachoir and timidity seem so confused, it might be rare enough in midi files that the developers of those programs weren't aware of it (past tense, as both seem pretty unmaintained).

I googled for an easy way to either make Musescore not use running status or mangle the midi files afterwards to contain "complete" midi events for testing, but had no success yet. I'd hate to have to dig in with a hex editor, but it should be doable for a small file. It'll be useful for pinpointing the exact reason for the bug.

(*) A way to save bytes in midi data through omitting the command byte. Not sure it's quite as useful for files as for transmission over a slowish serial link.

musikbear wrote: * change Q to 1/192
I'd be surprised if that helped, but this being LMMS I wouldn't dare bet any large sum against it either. :P
Progress. Using a couple of programs included with a midifile library (http://midifile.sapp.org/) I converted the file to not use running status and it now seems to import fine in LMMS.

I created an issue on github, https://github.com/LMMS/lmms/issues/2741, and with a little luck someone will find the time to fix this, possibly in time for 1.2.