napulen / AugmentedNet

A Roman Numeral Analysis Network with Synthetic Training Examples and Additional Tonal Tasks
MIT License
34 stars 7 forks source link

MIDI files for AugmentedNet #78

Closed adityac95 closed 2 years ago

adityac95 commented 2 years ago

Hi Nestor, you replied to my tweet seeking help with automatic chord annotation tools – thanks for offering to help me with AugmentedNet!

I’m hoping to generate chord annotations on a popular music MIDI dataset. I’m not certain that all of it was generated from notation, but for the most part when I load files into MuseScore or Sibelius they read fairly well. So I’m minded to try both versions 1.7.0 and 1.5.1 as you suggested. You mentioned a parser would be necessary for 1.5.1; is that something you have to hand or do you recommend any particular parsers that you've previously encountered?

I appreciate your help.

napulen commented 2 years ago

Hey @adityac95! Yup, I remember.

I’m hoping to generate chord annotations on a popular music MIDI dataset. I’m not certain that all of it was generated from notation, but for the most part when I load files into MuseScore or Sibelius they read fairly well.

Those are great news! Both of those notation software have ways to do batch conversion, so if that's possible for your dataset (I don't know how big it is), then please try to batch convert to MusicXML. That'd vastly simplify things. Just pass the folder with MusicXMLs to v1.7.0, with something like:

(.env) $ python -m AugmentedNet.inference --dir <folder_with_musicxmls>

and optionally --useGpu if you have a GPU.

So I’m minded to try both versions 1.7.0 and 1.5.1 as you suggested.

v1.7.0 is much much more accurate. If it's possible to run that one, I'd recommend it. The reason why I mentioned v1.5.1 as a fallback is that v1.7.0 needs measure and duration info, which only makes sense for something like MusicXML, whereas v1.5.1 is more generic. The data could run on regular MIDI files, but I'd probably need to write some patch for it.

Let's try with the v1.7.0 first, if you can do the batch conversion.

If that doesn't work out, let me know, and I'll check the alternative path.

Cheers.

napulen commented 2 years ago

On the experiments, this network outperforms Harmony Transformer v2, by the way. Worth the try.

adityac95 commented 2 years ago

Thanks for your help! I've successfully managed to use the pretrained v1.7.0 to predict chord annotations in my dataset. I'm surprised at how poor some of the predictions are, even though much of my dataset is highly triadic. I wonder if this has something to do with the model being trained on classical rather than popular music, since the functional harmonic logic is different in these styles. I'll keep experimenting, though!

napulen commented 2 years ago

Can you share one of the "bad" examples (input MusicXML or original MIDI or screenshot of a section with poor results)?

Genre has some effect, but it should handle a highly triadic dataset. I'm leaning more towards data loading/encoding problems. Seeing an example would help triaging.

napulen commented 2 years ago

If you prefer we can do this over email (napulen at gmail).

napulen commented 2 years ago

Hi @adityac95

Based on the examples provided, I determined that percussion tracks do hinder the performance of the model (see #79), because they introduce nonsensical pitch information.

A fix is in place #80.

A new release is coming right up with this change.

There was a noticeable improvement with the fix. This is on a version I found online of the track you mentioned (drumtrack highlighted):

image

And the analysis before and after the patch:

image

adityac95 commented 2 years ago

Thank you so much for looking into this and making the patch! Looking forward to trying out the new version when it's ready.

napulen commented 2 years ago

Ok, it's out! v1.7.1

If you re-run your files with the latest code you should notice some improvement.

I still don't know what to do exactly about transposing instruments, I think that's going to be a harder problem. But this should help for now.

napulen commented 2 years ago

By the way, @adityac95, as you mentioned you are only interested in the chord labels.

You already have them in the lyrics of the _annotated.xml, below the RNA. I recommend parsing the chord labels from those lyrics.

napulen commented 2 years ago

Hey @adityac95, did things work better after the patch?

adityac95 commented 2 years ago

yes, there was a definite improvement -- thank you!

napulen commented 2 years ago

awesome