Skip to content

Fix Midi Import of Multi-track File and CC Automation#8383

Merged
regulus79 merged 3 commits into
LMMS:masterfrom
regulus79:fix-midi-import
May 14, 2026
Merged

Fix Midi Import of Multi-track File and CC Automation#8383
regulus79 merged 3 commits into
LMMS:masterfrom
regulus79:fix-midi-import

Conversation

@regulus79
Copy link
Copy Markdown
Member

@regulus79 regulus79 commented May 13, 2026

Currently, importing midi files containing multiple tracks is not supported. All of the notes get merged onto a single track.

Except, LMMS actually does support multi-track midi import, it just ignores the track index when placing the notes, and simply puts them in tracks based on their midi channel instead. LMMS does not support setting the channel of an individual note, so separating the loaded midi events onto separate tracks based on their channel does make sense.

But we don't have to choose one or the other! This PR makes it so that the notes in midi files are split into different tracks based on both their midi channel and midi track. This allows midi files which contain multiple tracks to be loaded normally, and hopefully even multi-channel multi-track midi files.

Additionally, some midi files contain a wealth of information regarding midi CC automation. Currently, we only handle pitch, panning, volume, and bank automation when importing midi files, but this PR also makes it so that the knobs in the instrument track CC rack are also automated.

Before

I'm using METAL-GTX_Demo2.mid as an example. This midi files should contain several tracks for the different guitars, along with many CC knob parameter modulations for things like vibrato, etc to be handled by the SFZ player.

Currently, everything is loaded as a single track. This made things like key switches appear stacked, which made no sense, and everything sounded wrong when played on my SFZ player. There are a few automation clips for pitch, but that's about it.

image

After

Now all of the tracks in the midi file are loaded correctly. The key switches make sense now, and all the midi CC modulations are loaded too.

Screenshot From 2026-05-13 11-28-20

NOTE: Regarding the CC automations, some CC numbers correspond to things like panning and volume, which are real knobs in lmms. In the case that one of these CC's are automated, it creates an automation track for that specific lmms knob. Otherwise, it automates the knob in the instrument track's midi CC rack.

Copy link
Copy Markdown
Member

@messmerd messmerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM codewise

@regulus79
Copy link
Copy Markdown
Member Author

Thanks! @extern-stat on discord tested it and said it worked, so I think I might merge it.

@regulus79 regulus79 merged commit 658ce00 into LMMS:master May 14, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants