stevenwaterman / musetree

AI Music Generation for the Real World
http://musetree.stevenwaterman.uk/
MIT License
238 stars 33 forks source link

Percussion incorrect in exported midi #41

Closed PapayasTehSkeletor closed 4 years ago

PapayasTehSkeletor commented 4 years ago

I noticed a bug. When exporting the song to MIDI format, the percussion is exported wrong, not appearing as in the musetree piano roll and becoming... Well, this. I used the midi from the song Enemy Approaching from Undertale, and that's how the percussion of the song came out.

image

stevenwaterman commented 4 years ago

I'll try and look at this in the next day or two :)

A couple of questions:

Edit:

I tried generating a MIDI with percussion. I experienced a similar issue to you in https://onlinesequencer.net but it did work in https://solmire.com/midi-to-mp3

Could you try your MIDI in the second link and see if it works? It may just be a format/configuration issue - I don't know much about MIDIs

PapayasTehSkeletor commented 4 years ago

Just that song, or always? (If just that song, send a .mst save file that I can try)

Nope, just tried again with Beastars theme and got the same issue

If you import it back into MuseTree, is it correct?

Yes

Maybe this is just a problem with Fl Studio. Just tried with Anvil Studio and the percussion shows up normally.

Edit: Okay, if I just load and save the midi with Anvil Studio, I can open it in FL Studio normally. So... Dunno what's happening.

stevenwaterman commented 4 years ago

Could you send the files from before and after load->save in anvil? I'll try and compare them and see what's different. It sounds like MuseTree is slightly violating the MIDI spec, and some software is ok with it while others aren't.

PapayasTehSkeletor commented 4 years ago

https://filebin.net/28s7n1dgqolnohpo

MidiExport.mid is before Anvil MidiExport_2.mid is after Anvil.

stevenwaterman commented 4 years ago

Fab thank you, I'll try and look at that tomorrow :)

farfromsubtle commented 4 years ago

I noticed this happens with Studio One for me, but Logic Pro and Garage band are fine with it on the Mac.

farfromsubtle commented 4 years ago

This is sort of related but I also get varying results with other instruments from program to program. String instruments often end up being a mess off run-on sustained notes that overlap each other and look nothing like the musetree pianoroll. VLC plays them fine but in every DAW I have tried they are a mess. I can clean them up by setting their note length to a constant one but you lose some of the nuance that'll musenet provides.

farfromsubtle commented 4 years ago

Comparison of the strings part (pink).

Screen Shot 2020-05-21 at 0 15 48 Screen Shot 2020-05-21 at 0 14 13
stevenwaterman commented 4 years ago

Could you send me the save file? You can email me at musetree@stevenwaterman.uk if that's easiest :)

Also - 74 sections?! That's insane! I love it

farfromsubtle commented 4 years ago

This one got deep... I started on a cool fantasy forest vibe... then it became an 80s glam rock song that became an epic metal ballad ala Dragon force...

Side note: This will probably need to be it's own ticket but that projector has become very slow to preview new parts. When I click a new generation it hangs for a while and a Chrome helper maxes out at 100% on a single cpu thread. At first I thought it had something to with the rendering of the audio preview and how long the song was however it hangs even when clicking earlier parts near the top.

stevenwaterman commented 4 years ago

Opened a ticket for the notes lasting forever - it's a separate issue that I'm fixing now (https://github.com/stevenwaterman/musetree/issues/44)

If you're referring to the performance when selecting a new node then yes it probably is due to the length. There's quite a few bits of code that don't scale well and are on the to-do list. That save file will serve very nicely as a testbed!

stevenwaterman commented 4 years ago

Fixed in v2.1.4

The issue seemed to be that Drum notes were encoded with a NOTE_ON and never followed up with a NOTE_OFF. That's how it was done in MrCheeze's musenet-midi so I copied it but clearly it causes issues.

The workaround I'm using atm is that every drum NOTE_ON is immediately followed by NOTE_OFF. If those 0-length notes cause issues with your DAW, please let me know and we can find a better solution that works for everyone. I did that because it was simplest.