Making sheet music out of untimed hand played and piano roll midi files

• May 28, 2021 - 15:40

If you look at my profile and scroll through the scores, you'll find that I have made sheet music out of player piano rolls and hand played midi files that I didn't play to a metronome.

MuseScore has an algorithm of some sort that can find the approximate tempo of a midi file and quantify it to that tempo (though the software will remove syncopation and mess up grace notes). I use this to my advantage to make piano roll transcriptions, and sheet music of my own playing.

Unfortunately, the program has a terrible time mapping swing in midi files (especially foxtrots from piano rolls) and I usually have to quantize everything to an 8th note or 16th (depending on if I use normal tempo or double time).

This method is very time consuming and I wish there was a way that the program AT LEAST WOULDN'T REMOVE SYNCOPATION!!!! Correcting the removed syncopation is the most time consuming part of the process.


Comments

Have you tried playing wiht the swing settings in the import panel? In general swing shouldn't present any particular difficult - no more so than the usual difficulties inherent in any MIDI import, that is. Can you attach a specific MIDI file you are having trouble with?

But I would also say if the software you are using to record your MIDI file makes the simple act of quantizing "very time consuming", you might consider different software for the recording. Quantizing should be trivially simple in most MIDI recording software (eq, pretty much any DAW).

In reply to by Marc Sabatella

It's not that I'm having any particular difficulty but when MuseScore imports a piano roll scan that was recorded with swing (foxtrots played by J. Lawrence Cook are a perfect example) then the swing turns into notes in triplets to simulate swing which is exactly what it is. I have to then select everything except for grace notes, triplet trills etc. and quantize everything else.

In reply to by Marc Sabatella

Ok here's a midi file of a piano roll that i tried to quantize. It has a constant tempo because it's a timed piano roll puch matrix midi file. I split the tracks to help MuseScore not make an illegible piece of junk but it still couldn't map the swing no matter what setting I used on the import panel.

The second midi file (Your the cream in my coffee) is a straight piano roll scan that is not timed or anything. I've managed to quantify these but only by extensive syncopation fixing and quantization to remove all the swing which in this case is very very badly mapped into a mess of tuplets and augmented notes.

In reply to by Piotr Barcz

Carolina Shout seems off by a fraction a beat pretty much throughout. That is the notes that should be on the beat are not. No doubt that plays havoc with the swing recognition. If you can shift this in your sequencer to coincide with the metronome better, you'll have much better luck I suspect. Also probably better if you can convince your sequencer to output the relevant metadata to the actual piano track.

In reply to by Piotr Barcz

As far as I know, MuseScore doesn't usually "figure out" tempo, it's normally recorded directly in the MIDI file. But in cases where the info is missing, I don't think there would be any way to guess it. But my point here is, the MIDI file doesn't have a notion of "triplets" - just notes at pretty varying places relative to a beat that in fact is not the actual beat of the song. There's no way for MuseScore to recognize what you "intended" the file to contain, it can only see what is actually there. That's why being careful to play to a metronome, and being sure to quantize to that before export the MIDI file, is vitally important is a format like MIDI - never intended to be used for notation - is going to have any hope of producing decent results.

In reply to by Marc Sabatella

The thing is, this happens with midi files that have swing and are conventionally sequenced and the swing compensation just doesn't get rid of all the triplets. The only way I've found to make sheets from these files is to go through them and select all the notes that aren't part of triplets that are necessary to have in the score and quantize them to straighten the rhythm...

In reply to by Marc Sabatella

It is actually impossible for me to quantify a piano roll without Smart Tempo of some sort. This is a feature only high end paid programs have and I cannot afford to get Logic Pro or Ableton Live, both of which have that feature.

Piano roll scans that I have aren't recorded by me and even if they were there is no way for me to record them to a metronome.

In reply to by Pentatonus

Ummm, yeah, sort of, you can still see that a lot of the notes are on the second voice which isn't right, and also, there are still some screwed up spots in the swing even though the song is quantized...

But also, I want two staves, not four. I don't know really what this program does but I usually don't get that clean of a result...

In reply to by Piotr Barcz

Best way to get only two staves would be to use only one MIDI channel. As it is, MuseScore sees separate tracks and separate channels and thinks this is a two-pian duet. But assuming you are using track 1 for the top staff and track 2 for the bottom, just uncheck "split staff in the MIDI import dialog for each track, then hit apply

And indeed, you won't get a clean result importing MIDI - it was never designed to be a notation format and lacks a lot of really basic info that would be needed for good results.

In reply to by Marc Sabatella

I do usually uncheck the "split staff" because of how it doesn't even split the staff correctly xD, I have to admit though, this program has a fairly solid algorithm since I have actually hand played midi files and made sheet music of them as well. I have an example attached. I hand played the midi file as smoothly as I could but I did NOT record it with a metronome, MuseScore just finds the tempo and quantized the midi and made some pretty ok sheet music that I then edited because of how the program removes Syncopation (that's the one major annoyance). I kind of wish that the dev team would build on this and maybe incorporate an AI neural net or something to make sheet music from midi imports conform to modern notation conventions and so on.

Attachment Size
Maple Leaf Wrong.mscz 44.39 KB

In reply to by Piotr Barcz

Again, there is no such thing as "correctly" when it comes to how MIDI data is turned into notation. Every single AI algorithm that attempts to reconstruct the missing information - including the AI algorithm already built into MuseScore - will guess differently as to the best way to do it. That's just the nature of trying to use MIDI to build notation - tons and tons and tons of crucial info is missing, and a program will need to use AI to guess how to best reconstruct it. In almost all real world cases, you can expect to spend many times more work overriding the AI decisions using your own expertise than simply making the decisions yourself to begin by entering the music directly. AI technology just isn't anywhere near the level where you can expect this to go well in any but really simple cases. But sure, it's conceivably that in the coming decades this technology may mature. but consider. people have been working on this since the 1980's and it's still primitive.

In reply to by Piotr Barcz

Yes, certainly, that is always the case in any attempt to take something inherently incompatible with standard notation and try to turn it into readable notation. Countless decisions have to be made about to how represent rhythms, durations, enharmonic spelling, use of multiple voices and/or multiple staves, etc. Because MIDI is simply incapable of representing any of that, a computer program needs to make its own subjective decisions. That’s AI.

In reply to by Piotr Barcz

> "Why not have MuseScore embed text data into the midi file to tell the program on import what should be done to make the midi into notation"
Sure, we could invent a new MIDI format extension to include that information; perhaps even include some layout information. And while we're at it could probably also add styling information and whether a note should be written as a tied or not; and add a distinction between a staccato eight note or a dotted sixteenth...
... and probably just end up with the mscz format in the end...

In reply to by jeetee

Well it wouldn't be a completely new format, just simple text events. Many old midi files have simple text events chucked into the midi track. This information could be embedded when exporting a midi from MuseScore so that you can get accurate sheet music on import into MuseScore again.

In reply to by Piotr Barcz

The point I'm making is that if you start adding text events to the MIDI stream (thus creating an extension of the specification) to make it contain more score information that for you it might be enough to include just note spelling (for example). But for someone else it won't be enough; because why stop there? Why not also include messages that differentiate between a staccato note or not, or identify tuplets?

And if you then do finally end up with a score-like format in hopes that whichever other software you're processing that MIDI in won't destroy it; who's to say those messages still make sense after someone/something else processed that MIDI file?

If you want to save a score, then why not save in a score format instead?

In reply to by Piotr Barcz

Indeed, MIDI has that property and serves that prupse well. but its' terrible as a notation format. So simply use both formats - the right format for the right job. When you want the smallest possible file that can do playback on appropriate;ly-equipped devices, use MIDI. When you want to represent an actual score - standard musical notation - use MusicXML or MSCZ or another score format.

Just as a refrigerator is a great appliance for keeping food cold, but a terrible one for cooking an omelet. So use the appropriate appliance for the task at hand - no need to expect one tool to do both jobs.

In reply to by jeetee

it could solve the problem if someone only downloaded a midi file exported from MuseScore. I've had people not know what a MuseScore project is so they send me the midi files which are sometimes a pain to import back into MuseScore which is when this text information could be useful.

In reply to by Piotr Barcz

As mentioned, you are welcome to define your own unique extensions to the MIDI format that allow for text to describe notational details that MIDI otherwise doesn't happen. You would then also be welcome to develop your own software tools to assist you or other musicians in adding this text notation, and to contribute code to MsueScore to read those text instruments and convert them into the desired result. it's an enormous undertaking, probably at least a year for a sufficiently skilled programmer, but if it's important enough to you for you to undertake the work, no reason to believe it will never happen.

In reply to by Piotr Barcz

The answer remains the same as from the very beginning: MIDI was never ever meant for notation. it's completely incapable of doing the job. If the score was in MuseScore once and was readable, feel free to export to MIDI all you want and use that file for whatever other purposes you want. But if you want the see the original notation, simply re-open the original score, don't open the MIDI file in MuseScore.

Having a score in MuseScore, exporting to MIDI, and then opening the MIDI file but expecting to see something that looks as good as the original is completely nonsensical. It's about the same as having a cake, taking a picture of it, then later eating the picture and wondering why it doesn't taste as good as the cake did. The picture isn't the cake, and the MIDI isn't the score.

In reply to by Piotr Barcz

MuseScore could certainly invent a format for this add that info to any MIDI file it exports, but it won't help on a MIDi file you created through other means, unless you insert that information into the file yourself. So maybe a good starting place would be, you could make a formal proposal for a new format describing what that info might look like, then implement your own software to create that info. And then if it catches on, no doubt MuseScore would end up supporting it as well.

In reply to by Marc Sabatella

Like I said, no need for a new midi format, just text events in the midi string. As for making the events, yeah, there would have to be either a software to do it or some really simple text that you could put in for the basic information. I definitely don't have programming skills of any kind so making the program myself is out of the question... I might make a formal proposal as you suggested though.

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