[Regression] MIDI fixup for overlapping note shouldn't kick in for different midi tracks

• Mar 30, 2018 - 09:55
Reported version
2.3
Type
Functional
Severity
S4 - Minor
Status
closed
Project

A single instrument is exported to different MIDI tracks while in MuseScore it's played on the same channel. MIDI fixup for colliding notes should take this into account. Since it currently does, we have long sounding notes in MIDI

Simple example attached
Capture d'écran 2018-03-30 10.53.12.png

See : https://musescore.org/en/node/270869 and https://musescore.org/en/node/270823

Attachment Size
Midi_problems.mid 167 bytes
Midi_problems.mscz 4.93 KB

Comments

Definitely not. The same channel is the same channel, even
if on a different track ("channel" here means the tuple made
of MIDI port and MIDI channel, to have more than 15 instruments
playing at the same time), and collisions between the same channel
on different tracks (e.g. piano hands) must be handled the
same as collisions on the same track, because otherwise, you
get the "shorter note cuts off longer note" problem back.

In reply to by mirabilos

This is how it looks in the original version of the MIDI collisions patch:

Midi_problems3.png

This is entirely correct output for the scope of the fix (no restriking).

Then, you added the restrike patch, which fixed the problem that two “keydowns” in this example were removed, but introduced the change in MIDI output:

Midi_problems2.png

This, indeed, introduces two more or less slight problems. The MIDI output has collisions again (probably less slight for some players)

By contrast, this is how it looks when you assign different channels to the hands:

Midi_problems4.png

I’m wondering if restriking can’t be made to create similar-looking output… lemme think about it.

Status (old) patch (ready to commit) fixed
Status PR created fixed

Fixed in branch 2.2.1, commit d3bd3a280f

fix #270878: improve restriking

• hoist the temporary noteoff event created for restriking to the
same track as the corresponding noteon event
• use the restriking track for the “real” noteoff events

Note: staffIdx can be 0, so the + 1

Fixed in branch 2.3, commit 83b2f2372c

fix #270878: improve restriking

• hoist the temporary noteoff event created for restriking to the
same track as the corresponding noteon event
• use the restriking track for the “real” noteoff events

Note: staffIdx can be 0, so the + 1