Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MU3] Restrict the first exported MIDI track to timing events. #7523

Closed
wants to merge 1 commit into from

Conversation

OmarEmaraDev
Copy link

@OmarEmaraDev OmarEmaraDev commented Feb 13, 2021

Resolves: https://musescore.org/en/node/207346
Resolves: https://musescore.org/en/node/273557

Currently, exported MIDI files will have data events in the first MIDI
track. While this is not forbidden by the standard, the industry
convention is to only put timing related events in the first track, in
which case it is called a tempo track. MuseScore should follow that
convention because a lot of the available software assumes this
convention. This has been discussed and agreed upon in:

https://musescore.org/en/node/207346

This doesn't update the tests, which I guess needs to be updated. Any pointers of how I should do that?

  • I signed CLA
  • I made sure the code in the PR follows the coding rules
  • I made sure the code compiles on my machine
  • I made sure there are no unnecessary changes in the code
  • I made sure the title of the PR reflects the core meaning of the issue you are solving
  • I made sure the commit message(s) contain a description and answer the question "Why do those changes fix that particular issue?" or "Why are those changes really necessary as improvements?"
  • I made sure the commit message title starts with "fix #424242:" if there is a related issue
  • I created the test (mtest, vtest, script test) to verify the changes I made

@ericfont
Copy link
Contributor

@OmarEmaraDev, your code changes look ok, however the mtest for midi failed (Test #28 tst_midi), as shown in the build log (https://github.com/musescore/MuseScore/pull/7523/checks?check_run_id=1894954476#step:5:739) with messages:

Binary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testBends1-ref.mid and testBends1.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testBends1-ref.mid testBends1.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testBends2-ref.mid and testBends2.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testBends2-ref.mid testBends2.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testMidiPort-ref.mid and testMidiPort.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testMidiPort-ref.mid testMidiPort.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testArpeggio-ref.mid and testArpeggio.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testArpeggio-ref.mid testArpeggio.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testMutedUnison-ref.mid and testMutedUnison.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testMutedUnison-ref.mid testMutedUnison.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testInitialKeySigThenRepeatToMeas2-ref.mid and testInitialKeySigThenRepeatToMeas2.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testInitialKeySigThenRepeatToMeas2-ref.mid testInitialKeySigThenRepeatToMeas2.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testRepeatsWithKeySigs-ref.mid and testRepeatsWithKeySigs.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testRepeatsWithKeySigs-ref.mid testRepeatsWithKeySigs.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testRepeatsWithKeySigsExceptFirstMeas-ref.mid and testRepeatsWithKeySigsExceptFirstMeas.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testRepeatsWithKeySigsExceptFirstMeas-ref.mid testRepeatsWithKeySigsExceptFirstMeas.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testVoltaTemp-ref.mid and testVoltaTemp.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testVoltaTemp-ref.mid testVoltaTemp.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testVoltaDynamic-ref.mid and testVoltaDynamic.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testVoltaDynamic-ref.mid testVoltaDynamic.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testVoltaStaffText-ref.mid and testVoltaStaffText.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testVoltaStaffText-ref.mid testVoltaStaffText.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermata-ref.mid and testTimeStretchFermata-page-test-1.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermata-ref.mid testTimeStretchFermata-page-test-1.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermata-ref.mid and testTimeStretchFermata-page-test-2.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermata-ref.mid testTimeStretchFermata-page-test-2.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermata-ref.mid and testTimeStretchFermata-page-test-3.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermata-ref.mid testTimeStretchFermata-page-test-3.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermata-ref.mid and testTimeStretchFermata-linear-test-1.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermata-ref.mid testTimeStretchFermata-linear-test-1.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermata-ref.mid and testTimeStretchFermata-linear-test-2.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermata-ref.mid testTimeStretchFermata-linear-test-2.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermata-ref.mid and testTimeStretchFermata-linear-test-3.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermata-ref.mid testTimeStretchFermata-linear-test-3.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermataTempoEdit-200-ref.mid and testTimeStretchFermataTempoEdit-page-test-init.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermataTempoEdit-200-ref.mid testTimeStretchFermataTempoEdit-page-test-init.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermataTempoEdit-120-ref.mid and testTimeStretchFermataTempoEdit-page-test-change-tempo.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermataTempoEdit-120-ref.mid testTimeStretchFermataTempoEdit-page-test-change-tempo.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermataTempoEdit-200-ref.mid and testTimeStretchFermataTempoEdit-page-test-undo-change-tempo.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermataTempoEdit-200-ref.mid testTimeStretchFermataTempoEdit-page-test-undo-change-tempo.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermataTempoEdit-120-ref.mid and testTimeStretchFermataTempoEdit-page-test-remove-tempo.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermataTempoEdit-120-ref.mid testTimeStretchFermataTempoEdit-page-test-remove-tempo.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermataTempoEdit-200-ref.mid and testTimeStretchFermataTempoEdit-page-test-undo-remove-tempo.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermataTempoEdit-200-ref.mid testTimeStretchFermataTempoEdit-page-test-undo-remove-tempo.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermataTempoEdit-200-ref.mid and testTimeStretchFermataTempoEdit-linear-test-init.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermataTempoEdit-200-ref.mid testTimeStretchFermataTempoEdit-linear-test-init.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermataTempoEdit-120-ref.mid and testTimeStretchFermataTempoEdit-linear-test-change-tempo.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermataTempoEdit-120-ref.mid testTimeStretchFermataTempoEdit-linear-test-change-tempo.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermataTempoEdit-200-ref.mid and testTimeStretchFermataTempoEdit-linear-test-undo-change-tempo.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermataTempoEdit-200-ref.mid testTimeStretchFermataTempoEdit-linear-test-undo-change-tempo.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermataTempoEdit-120-ref.mid and testTimeStretchFermataTempoEdit-linear-test-remove-tempo.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermataTempoEdit-120-ref.mid testTimeStretchFermataTempoEdit-linear-test-remove-tempo.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermataTempoEdit-200-ref.mid and testTimeStretchFermataTempoEdit-linear-test-undo-remove-tempo.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testTimeStretchFermataTempoEdit-200-ref.mid testTimeStretchFermataTempoEdit-linear-test-undo-remove-tempo.mid failedBinary files /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testSingleNoteDynamics-ref.mid and testSingleNoteDynamics-test.mid differ
   <diff -u /home/runner/work/MuseScore/MuseScore/mtest/libmscore/midi/testSingleNoteDynamics-ref.mid testSingleNoteDynamics-test.mid failed

I believe to fix this, you will need to update those mtest midi reference files (*-ref.mid) to have the tempo track on the first track, since presumably those reference files were made according to the old behavior of not having the first track be tempo only.

@ericfont
Copy link
Contributor

This doesn't update the tests, which I guess needs to be updated. Any pointers of how I should do that?

ahh, I see you did ask that question. I would say that since your PR updates the behavior to produce different midi output files, then I would say to simply copy the resulting midi files that your PR produces into the MuseScore/mtest/libmscore/midi/ folder and rename them by appending "-ref" before the ".mid" extension. Then when we look at the diff of those midi files we should see that the only thing different is that tempo events have been moved to a tempo-only initial track.

@OmarEmaraDev
Copy link
Author

@ericfont Thanks! I updated the test files. Here is a diff for one of the test files. Looks correct to me.

diff --git a/tmp/testTimeStretchFermataTempoEdit-200-ref.txt b/tmp/testTimeStretchFermataTempoEdit-page-test-init.txt
index 24e2bb9..ee0c7d0 100644
--- a/tmp/testTimeStretchFermataTempoEdit-200-ref.txt
+++ b/tmp/testTimeStretchFermataTempoEdit-page-test-init.txt
@@ -1,8 +1,18 @@
 =====Track Start=====
-TrackNameEvent(deltaTime=0, name='Piano\x00')
 TimeSignatureEvent(deltaTime=0, numerator=2, denominator=2, clocksPerClick=24, thirtySecondPer24Clocks=8)
-KeySignatureEvent(deltaTime=0, flatsSharps=0, majorMinor=0)
 TempoEvent(deltaTime=0, tempo=300000)
+TempoEvent(deltaTime=960, tempo=1000000)
+TempoEvent(deltaTime=960, tempo=300000)
+TempoEvent(deltaTime=1920, tempo=900001)
+TempoEvent(deltaTime=479, tempo=300000)
+TempoEvent(deltaTime=1441, tempo=900001)
+TempoEvent(deltaTime=479, tempo=300000)
+TempoEvent(deltaTime=1441, tempo=1000000)
+TempoEvent(deltaTime=960, tempo=300000)
+EndOfTrackEvent(deltaTime=1)
+=====Track Start=====
+TrackNameEvent(deltaTime=0, name='Piano\x00')
+KeySignatureEvent(deltaTime=0, flatsSharps=0, majorMinor=0)
 ControllerEvent(deltaTime=0, channel=0, controller=121, value=0)
 ControllerEvent(deltaTime=0, channel=0, controller=100, value=0)
 ControllerEvent(deltaTime=0, channel=0, controller=101, value=0)
@@ -19,9 +29,7 @@ NoteOnEvent(deltaTime=0, channel=0, note=72, velocity=80)
 NoteOffEvent(deltaTime=479, channel=0, note=72, velocity=0)
 NoteOnEvent(deltaTime=1, channel=0, note=74, velocity=80)
 NoteOffEvent(deltaTime=479, channel=0, note=74, velocity=0)
-TempoEvent(deltaTime=1, tempo=1000000)
-TempoEvent(deltaTime=960, tempo=300000)
-NoteOnEvent(deltaTime=0, channel=0, note=72, velocity=80)
+NoteOnEvent(deltaTime=961, channel=0, note=72, velocity=80)
 NoteOffEvent(deltaTime=479, channel=0, note=72, velocity=0)
 NoteOnEvent(deltaTime=1, channel=0, note=74, velocity=80)
 NoteOffEvent(deltaTime=479, channel=0, note=74, velocity=0)
@@ -29,29 +37,23 @@ NoteOnEvent(deltaTime=1, channel=0, note=69, velocity=80)
 NoteOffEvent(deltaTime=479, channel=0, note=69, velocity=0)
 NoteOnEvent(deltaTime=1, channel=0, note=71, velocity=80)
 NoteOffEvent(deltaTime=479, channel=0, note=71, velocity=0)
-TempoEvent(deltaTime=1, tempo=900001)
-NoteOnEvent(deltaTime=0, channel=0, note=69, velocity=80)
-TempoEvent(deltaTime=479, tempo=300000)
-NoteOffEvent(deltaTime=0, channel=0, note=69, velocity=0)
+NoteOnEvent(deltaTime=1, channel=0, note=69, velocity=80)
+NoteOffEvent(deltaTime=479, channel=0, note=69, velocity=0)
 NoteOnEvent(deltaTime=1, channel=0, note=71, velocity=80)
 NoteOffEvent(deltaTime=479, channel=0, note=71, velocity=0)
 NoteOnEvent(deltaTime=1, channel=0, note=65, velocity=80)
 NoteOffEvent(deltaTime=479, channel=0, note=65, velocity=0)
 NoteOnEvent(deltaTime=1, channel=0, note=67, velocity=80)
 NoteOffEvent(deltaTime=479, channel=0, note=67, velocity=0)
-TempoEvent(deltaTime=1, tempo=900001)
-NoteOnEvent(deltaTime=0, channel=0, note=65, velocity=80)
-TempoEvent(deltaTime=479, tempo=300000)
-NoteOffEvent(deltaTime=0, channel=0, note=65, velocity=0)
+NoteOnEvent(deltaTime=1, channel=0, note=65, velocity=80)
+NoteOffEvent(deltaTime=479, channel=0, note=65, velocity=0)
 NoteOnEvent(deltaTime=1, channel=0, note=67, velocity=80)
 NoteOffEvent(deltaTime=479, channel=0, note=67, velocity=0)
 NoteOnEvent(deltaTime=1, channel=0, note=60, velocity=80)
 NoteOffEvent(deltaTime=479, channel=0, note=60, velocity=0)
 NoteOnEvent(deltaTime=1, channel=0, note=62, velocity=80)
 NoteOffEvent(deltaTime=479, channel=0, note=62, velocity=0)
-TempoEvent(deltaTime=1, tempo=1000000)
-TempoEvent(deltaTime=960, tempo=300000)
-NoteOnEvent(deltaTime=0, channel=0, note=60, velocity=80)
+NoteOnEvent(deltaTime=961, channel=0, note=60, velocity=80)
 NoteOffEvent(deltaTime=479, channel=0, note=60, velocity=0)
 NoteOnEvent(deltaTime=1, channel=0, note=62, velocity=80)
 NoteOffEvent(deltaTime=479, channel=0, note=62, velocity=0)

@ericfont
Copy link
Contributor

Thanks. Yeah looking at that diff and it seems the new midi output file correctly only differs in having the tempo events in the first channel, and the only change with other events like note on events is that the deltaTimes of the note on events are appropriately adjusted.

For the record, which other midi programs have you opened these new musescore output midi files with, and do they seem to import fine?

@ericfont
Copy link
Contributor

And now that you've updated the ref files, the mtest naturally is now passing, good.

@OmarEmaraDev
Copy link
Author

OmarEmaraDev commented Feb 14, 2021

@ericfont I only tried QTractor and our parser and they seems to import fine. I don't have other programs installed at the moment. But I can install and test more if it is required.

@ericfont
Copy link
Contributor

ericfont commented Feb 14, 2021 via email

@OmarEmaraDev
Copy link
Author

I tried importing and comparing the old and the new files into the following programs with the mentioned results.

  • QTracktor. (Works. Identical.)
  • LMMS. (Works. LMMS likes the new files better and is able to extract more information like track names.)
  • Ardour. (Works. Also likes the new files better with better extracted information.)
  • Audacity. (Works. Identical.)
  • Timidity++. (Works. MIDI converted to OGG then compared in Audacity. Identical except testBlend2-ref.mid.)

In conclusion, it works everywhere I tested and is identical or better than the old files. For Timidity++ in testBlend2-ref.mid, I don't know why there is a difference between the old and the new file. But Timidity++ reports this for the old file:

Format: 1  Tracks: 2  Divisions: 480
Sequence: Electric Guitar
Track name: Acoustic Guitar

And this for the new file:

Format: 1  Tracks: 3  Divisions: 480
Track name: Electric Guitar
Track name: Acoustic Guitar

So it seems it detects the first track as a "Sequence" and not a track. I don't know what that means, but the result for the the new files seems more correct. Here is the diff for that file:

diff --git a/tmp/2.txt b/tmp/1.txt
index ad159fa..f4a3df9 100644
--- a/tmp/2.txt
+++ b/tmp/1.txt
@@ -1,8 +1,10 @@
 =====Track Start=====
-TrackNameEvent(deltaTime=0, name='Electric Guitar\x00')
 TimeSignatureEvent(deltaTime=0, numerator=4, denominator=2, clocksPerClick=24, thirtySecondPer24Clocks=8)
-KeySignatureEvent(deltaTime=0, flatsSharps=0, majorMinor=0)
 TempoEvent(deltaTime=0, tempo=500000)
+EndOfTrackEvent(deltaTime=1)
+=====Track Start=====
+TrackNameEvent(deltaTime=0, name='Electric Guitar\x00')
+KeySignatureEvent(deltaTime=0, flatsSharps=0, majorMinor=0)
 ControllerEvent(deltaTime=0, channel=0, controller=121, value=0)
 ControllerEvent(deltaTime=0, channel=0, controller=100, value=0)
 ControllerEvent(deltaTime=0, channel=0, controller=101, value=0)

I couldn't test on any proprietary software. But I think the patch is fine testing wise by now.

@mattmcclinch
Copy link
Contributor

@OmarEmaraDev, nice job! I was looking at your patch and I had a thought: what if we construct the tempo track at the beginning of ExportMidi::write(), but wait until the end of the function before inserting it into the list of MidiTracks in the MidiFile? That way, we wouldn't have to keep skipping the tempo track every time we iterate over the list. The patch would then look something like this: mattmcclinch@5fb7b09

@OmarEmaraDev
Copy link
Author

@mattmcclinch I like the way you implemented that! I would maybe rename the input of the function to tempoTrack as well for clarity.

@mattmcclinch
Copy link
Contributor

Well, yes, so would I. And then I would rename track1 to track.

@OmarEmaraDev
Copy link
Author

@mattmcclinch Updated the patch with your suggestion. Thanks!

@mattmcclinch
Copy link
Contributor

@OmarEmaraDev, I would squash the first and third commits, since the latter basically reverts the former. I might even squash the second along with them, but definitely the first and third.

@OmarEmaraDev
Copy link
Author

@mattmcclinch I think the pull request should be squashed when merging instead. I see no value in doing it on the source branch directly.

@Jojo-Schmitz
Copy link
Contributor

Squashing is in the responsibility of the requestor, not the merger.

Currently, exported MIDI files will have data events in the first MIDI
track. While this is not forbidden by the standard, the industry
convention is to only put timing related events in the first track, in
which case it is called a tempo track. MuseScore should follow that
convention because a lot of the available software assumes this
convention. This has been discussed and agreed upon in:

https://musescore.org/en/node/207346
@OmarEmaraDev
Copy link
Author

@Jojo-Schmitz Done. I am not used to this workflow, so let me know if I should have done this differently.

Copy link
Contributor

@mattmcclinch mattmcclinch left a comment

Choose a reason for hiding this comment

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

Looks good to me. And again, nice job!

Also, kudos for knowing how to create "diff-able" text representations of MIDI files. Would you mind sharing how you did that?

@OmarEmaraDev
Copy link
Author

@mattmcclinch I wrote a small MIDI parser a while back (https://github.com/OmarEmaraDev/midi-parser) and just used it to dump all events as follows:

import sys
from midiparser.parser import MidiFile

midi = MidiFile.fromFile(sys.argv[1])
for track in midi.tracks:
    print("=" * 5 + "Track Start" + "=" * 5)
    for event in track.events:
        print(event)

@ericfont
Copy link
Contributor

Regarding PR commit squashing, I'm looking up the github docs and it seems GitHub has a feature to optionally automatically do that: https://docs.github.com/en/github/administering-a-repository/configuring-commit-squashing-for-pull-requests

Allow squash merging. This allows contributors to merge a pull request by squashing all commits into a single commit. If you select another merge method besides Allow squash merging, collaborators will be able to choose the type of merge commit when merging a pull request.

@Jojo-Schmitz
Copy link
Contributor

As far as I can tell that is only for those doing the merges, not for us 'mere mortals' though

@OmarEmaraDev
Copy link
Author

Is there a reason why this haven't been merged yet? Do I need to do something?

@Jojo-Schmitz
Copy link
Contributor

As there's no further 3.x release planned, you'd probably have to rebase/port this to the master branch, for it to be in MuseScore 4

@OmarEmaraDev
Copy link
Author

@Jojo-Schmitz If I recall correctly, the MIDI exporter wasn't in master. You mean port the whole exporter first?

@Jojo-Schmitz
Copy link
Contributor

No idea, sorry.

@Jojo-Schmitz
Copy link
Contributor

You addded 15 MIDI reference files, but no tests using them?

Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 4, 2021
Currently, exported MIDI files will have data events in the first MIDI
track. While this is not forbidden by the standard, the industry
convention is to only put timing related events in the first track, in
which case it is called a tempo track. MuseScore should follow that
convention because a lot of the available software assumes this
convention. This has been discussed and agreed upon in:

https://musescore.org/en/node/207346

Duplicate of musescore#7523 (I can't attribute it to @OmarEmaraDev though)
@OmarEmaraDev
Copy link
Author

@Jojo-Schmitz Those are updated files to the existing ones in the tree (https://github.com/musescore/MuseScore/tree/3.x/mtest/libmscore/midi), not sure why Github shows them as new files.

@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Sep 4, 2021

I see, maybe it is just a git/GitHub quirk with binary files?
Edit: Ah, I see, my mistake...
Anyway, I've added this to #9000 just now.
If you tell me your name and email (via a PM if needed), I'd attribute that commit to you.
Edit 2: I managed...

Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 4, 2021
Currently, exported MIDI files will have data events in the first MIDI
track. While this is not forbidden by the standard, the industry
convention is to only put timing related events in the first track, in
which case it is called a tempo track. MuseScore should follow that
convention because a lot of the available software assumes this
convention. This has been discussed and agreed upon in:

https://musescore.org/en/node/207346

Duplicate of musescore#7523 (I can't attribute it to @OmarEmaraDev though)
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 4, 2021
Currently, exported MIDI files will have data events in the first MIDI
track. While this is not forbidden by the standard, the industry
convention is to only put timing related events in the first track, in
which case it is called a tempo track. MuseScore should follow that
convention because a lot of the available software assumes this
convention. This has been discussed and agreed upon in:

https://musescore.org/en/node/207346

Duplicate of musescore#7523
@OmarEmaraDev
Copy link
Author

@Jojo-Schmitz Looks good then. Should I close this pull request?

Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 4, 2021
Currently, exported MIDI files will have data events in the first MIDI
track. While this is not forbidden by the standard, the industry
convention is to only put timing related events in the first track, in
which case it is called a tempo track. MuseScore should follow that
convention because a lot of the available software assumes this
convention. This has been discussed and agreed upon in:

https://musescore.org/en/node/207346

Duplicate of musescore#7523
@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Sep 4, 2021

I guess so. You still may want to port it over to master, for inclusion in MuseScore 4

(Maybe let's see first whether #9000 passes all the mtests? Edit: they did pass)

Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 4, 2021
Currently, exported MIDI files will have data events in the first MIDI
track. While this is not forbidden by the standard, the industry
convention is to only put timing related events in the first track, in
which case it is called a tempo track. MuseScore should follow that
convention because a lot of the available software assumes this
convention. This has been discussed and agreed upon in:

https://musescore.org/en/node/207346

Duplicate of musescore#7523
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 4, 2021
Currently, exported MIDI files will have data events in the first MIDI
track. While this is not forbidden by the standard, the industry
convention is to only put timing related events in the first track, in
which case it is called a tempo track. MuseScore should follow that
convention because a lot of the available software assumes this
convention. This has been discussed and agreed upon in:

https://musescore.org/en/node/207346

Duplicate of musescore#7523
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 4, 2021
Currently, exported MIDI files will have data events in the first MIDI
track. While this is not forbidden by the standard, the industry
convention is to only put timing related events in the first track, in
which case it is called a tempo track. MuseScore should follow that
convention because a lot of the available software assumes this
convention. This has been discussed and agreed upon in:

https://musescore.org/en/node/207346

Duplicate of musescore#7523
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 9, 2021
Currently, exported MIDI files will have data events in the first MIDI
track. While this is not forbidden by the standard, the industry
convention is to only put timing related events in the first track, in
which case it is called a tempo track. MuseScore should follow that
convention because a lot of the available software assumes this
convention. This has been discussed and agreed upon in:

https://musescore.org/en/node/207346

Duplicate of musescore#7523
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 10, 2021
Currently, exported MIDI files will have data events in the first MIDI
track. While this is not forbidden by the standard, the industry
convention is to only put timing related events in the first track, in
which case it is called a tempo track. MuseScore should follow that
convention because a lot of the available software assumes this
convention. This has been discussed and agreed upon in:

https://musescore.org/en/node/207346

Duplicate of musescore#7523
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 23, 2021
Currently, exported MIDI files will have data events in the first MIDI
track. While this is not forbidden by the standard, the industry
convention is to only put timing related events in the first track, in
which case it is called a tempo track. MuseScore should follow that
convention because a lot of the available software assumes this
convention. This has been discussed and agreed upon in:

https://musescore.org/en/node/207346

Duplicate of musescore#7523
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 24, 2021
Currently, exported MIDI files will have data events in the first MIDI
track. While this is not forbidden by the standard, the industry
convention is to only put timing related events in the first track, in
which case it is called a tempo track. MuseScore should follow that
convention because a lot of the available software assumes this
convention. This has been discussed and agreed upon in:

https://musescore.org/en/node/207346

Duplicate of musescore#7523
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 26, 2021
Currently, exported MIDI files will have data events in the first MIDI
track. While this is not forbidden by the standard, the industry
convention is to only put timing related events in the first track, in
which case it is called a tempo track. MuseScore should follow that
convention because a lot of the available software assumes this
convention. This has been discussed and agreed upon in:

https://musescore.org/en/node/207346

Duplicate of musescore#7523
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 29, 2021
Currently, exported MIDI files will have data events in the first MIDI
track. While this is not forbidden by the standard, the industry
convention is to only put timing related events in the first track, in
which case it is called a tempo track. MuseScore should follow that
convention because a lot of the available software assumes this
convention. This has been discussed and agreed upon in:

https://musescore.org/en/node/207346

Duplicate of musescore#7523
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request May 12, 2022
Currently, exported MIDI files will have data events in the first MIDI
track. While this is not forbidden by the standard, the industry
convention is to only put timing related events in the first track, in
which case it is called a tempo track. MuseScore should follow that
convention because a lot of the available software assumes this
convention. This has been discussed and agreed upon in:

https://musescore.org/en/node/207346

Duplicate of musescore#7523
@RomanPudashkin
Copy link
Contributor

3.x is closed for any changes

Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Mar 5, 2023
Currently, exported MIDI files will have data events in the first MIDI
track. While this is not forbidden by the standard, the industry
convention is to only put timing related events in the first track, in
which case it is called a tempo track. MuseScore should follow that
convention because a lot of the available software assumes this
convention. This has been discussed and agreed upon in:

https://musescore.org/en/node/207346

Duplicate of musescore#7523
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.

5 participants