Customizing MIDI output, dropping staff from output

• Jan 6, 2021 - 02:53

I did this once way back in 2.x and now finally managed to refresh my memory and build 3.6 RC so it runs, and then customize exportmidi. All works. Mostly.

Is there any current ability to customize midi output, notably to suppress a given staff? I have a lot of 3 staff piano music, and when I export, it exports all three. I only want the piano part. I changed the top staff to voice, changed the name in the mixer, tried muting the mixer... it still outputs that.

Since I was customizing that is easy to fix, and I have (I just check for the name "piano"), but ....

The change rest of the change I made is potentially of interest to others. At worst it would do no real harm. It puts a meta field in with a measure number (e.g. "Measure 12") that corresponds to the PRINTED measure number. This is ignored generally by a midi player, but a player COULD use it to display progress, or to allow repositioning. Which is what I use it for in a custom pianodisc player.

If repeats are unrolled this means the printed measure number is repeated in the midi file, matching the print, not just a counted measure.

But certainly blocking any output not listed as "Piano" is not of general use. And while I maybe, possibly could figure out how to do a PR to see if anyone wants my measure numbering, I do not really have time or energy to figure out how to customize midi output generally, with all the UI changes it would entail.

So I thought I would ask... is any of this already either done, or a work in progress I did not see, that might be worth looking into?

Is there a way I can suppress a staff I just did not run across?

The easiest thing is I just keep my changes local, merge other changes in as needed. But I thought it work asking.

By the way -- last time I did this (maybe 2016 or 2017) QT Creator worked great for compiles and debugging. I managed to compile in a little batch script (as per the handbook) but had zero luck doing a full cmake project, and I know that all worked before. I was using qt Creator 4.14.0 with Desktop QT 5.15.2 and MSVC2019 64 bit on Windows 10 Pro x 64. I can't even tell you what was wrong, it would configure then builds would run and appear to work, but almost everything was flagged by the analyzers as syntax errors, as though it had not seen any QT headers (flagging mostly qt items not c++). I really do not need it to work, as I got it to edit and built manually, but it was a pain not having a working debugger (it kept saying I was using a 32 bit debugger -- but I had both listed and definitely installed).

Is QT Creator now a real mess with Musescore? Is this better in a linux environment (I could move there, this was just easier).

Thanks for any insight,



Qt Creator still runs just just fine. But for building any 3.x branch, you'd need Qt 5.9 (or 5.12), Qt 5.15 won't work there. You need Qt 5.12 though for building the master branch.

Have you considered either creating a part in the score with just the instrument you want and exporting that?
Or remove the other instruments from the score (Edit → Instruments...)?

In reply to by jeetee

As to removing an instrument, making it not visible has no impact.

Removing it from the score clearly works. I had not even considered that, frankly, having a blind spot because I wanted it in the score -- but I can remove, export and just throw that version away. That's a far more simple solution than code. Thank you.

So back to my implied question: Does anyone have an interest in putting measure labels inside the MIDI file? I'm happy to share, but it may be a sufficiently specialized need that it is not worth it (and worth me figuring out how to do a PR, hoops to jump, etc.).

Do you still have an unanswered question? Please log in first to post your question.