MIDI Import

As I was having some difficulty with garbling of imported MIDI files, so I did an experiment where I exported MIDI from Dorico then imported it again. Still, a fair bit of crazy nested tuplets and two voices in what should be a one voice part. I’ve attached the before and after versions. Can anyone give any insight into why this happens? What am I missing or doing wrong?
Thanks in advance!
DrumsMIDIExportTest.dorico.zip (414 KB)
DrumsMIDIExportTest_result.dorico.zip (420 KB)

When you export MIDI are you exporting the altered “playback” note-lengths in the Play Piano Roll instead of the notated lengths?

Sorry, GryptpypeThynne, but can you explain a bit more about the problem you’re having? It sounds like you’re having problems with MIDI import, so you decided to try to diagnose it by importing a MIDI file into Dorico, exporting it from Dorico also as a MIDI file, and then opening that exported MIDI file again in Dorico. If so, I wouldn’t recommend this as an approach to diagnosing a problem: it’s more like a game of Chinese whispers.

Can you be specific about the nature of the problem you’re experiencing? If there’s a MIDI file created in e.g. Cubase or another DAW that’s not importing cleanly, please attach it, together with (if possible) a PDF or screen grab from the scoring window of whichever program produced it, so that we can measure Dorico’s results against your expectations. Thanks!

Hi Daniel, I haven’t altered any playback lengths in the piano roll. I wrote this file in Dorico, exported it as MIDI, and imported it again.

OK, but can you say why you’re round-tripping data to and from Dorico using MIDI? What are you trying to prove/disprove? Is this something that you’re doing because you find it suggestive of another issue, or is it something you’re doing for fun, or what?

Ah sorry, I see the lack of clarity on my part.
I was having some issues with importing MIDI into Dorico, and I was trying to narrow down where the issue was coming from. I wanted to figure out if the unusual rhythms were coming from the program I was using to export MIDI, I figured the best way to generate MIDI that Dorico would definitely understand would be to generate it with Dorico itself.
Since the unusual rhythms are still there, I guess the remaining options are either that Dorico is exporting the MIDI strangely, or having trouble importing it.

The difficulty will almost certainly be on the import side, rather than on export. Export is “easy” because we know what the note durations are, and all we have to do is convert them to the appropriate number of MIDI ticks. Import is an entirely different matter, because Dorico has to interpret the MIDI data and try to figure out what those note durations might be. For simple note values there’s no ambiguity, but for tuplets, unquantized durations, etc., there’s a great deal of scope for different interpretations.

If you have a specific problem with importing MIDI, please provide a minimal MIDI file along with how you expect the notation to appear (e.g. a screenshot of the score editor window from your DAW/sequencer) so we can take a specific look. Unfortunately talking in generalities is unlikely to provide any improvement!

Okay here goes:
Here is the notation (entered in Dorico) pre-export:

here is the resulting MIDI file:
DrumsMIDIExportTest2_export.mid.zip (1.04 KB)
and here is the resulting notation when imported:

Hi GrypttypeThynne,
I know what you are talking about. I have also some problems like this when I import some MIDI files from GP5 to Dorico (low notes goes to a second voice, english horn recognised as a piano, grace notes became full semiquavers, tuplets became a mix of quaver, semiquaver or quarter note).
I just do complete check of the imported score to do some manual corrections if needed.

Ed-222, fair enough, but if you have a look at the before and after images I posted above, this is a little bit beyond a quick check—more in the range of a full re-write from scratch.

I think you may have slightly unrealistic expectations of how well Dorico will import what is a very complex drum part. I’ve tried importing into Sibelius and it’s completely different. If you edit the kit to change the stem directions to up then you get a lot closer to the original compared to what you have here. Some specific things though:

  • tuplets are a total headache. Dorico has to try to recognise the tuplet structure from the MIDI and then reconstruct a 5 line stave from it. At that point Dorico doesn’t know whether the bass drum is going to end up on the same stem as the snare and hence whether it’s part of the same tuplet structure (consider the case where a snare plays triplets over a bass drum playing crotchets - in that case you two independent structures). It’s true that there are a number of tuplet import cases that we can improve in the future that would remove lots of the tuplet noise from this example
  • grace notes aren’t currently recognised as grace notes, they’re just very short notes that are annotated as such. Worse, if they are played before the beat then they distort the rhythm and the tuplet detection code (so they may give rise to an extra tuplet)
  • this example has unmeasured tremolos (3 slashes). Because of this they’re not played back at a fixed rhythmic rate, they’re played with a specific duration in absolute time. As such they can’t be notated sensibly, so end up either with another tuplet or a note with multiple noteheads. Detecting an unmeasured tremolo from MIDI is not a trivial task
  • Dorico uses a small amount of random ‘humanisation’ by default which makes detection of tuplets harder because they don’t exactly line up.

Hi Paul,

Thank you very much for your in-depth reply! I understand that this is difficult stuff, and realize that my expectations may have been a little high. I had assumed, I guess a little naively, that since Dorico was the one generating the MIDI, it would know exactly what to look for in the detection process.
The one thing that stuck out for me was the bit about humanization. Is there (or will there be) a way to turn this off? Alternatively, could you give me an idea of the range of variation this humanization causes, so that I might be able to quantize it out in another program?

Thanks in advance!

Dorico has no way of knowing where a MIDI file came from, and even if we did know that it originated in Dorico then there’s not much we can infer from that since all the contextual information about grace notes, tremolos and tuplets has been lost. The process of importing a MIDI file is not a translation, it’s an interpretation, which has to spot patterns and read between the lines. If you have problems with importing a specific MIDI file (and not one that was created in Dorico) please post here (or a representative sample of one) and we can take a look.

The amount of humanisation is typically very small, but you can adjust or disable it (by setting to 0%) in Playback Options / Timing.

Thanks Paul! I appreciate your replies.
If I come across a MIDI import issue with a file not from Dorico I’ll come back to this!

Thanks again