Training an AI model with midi corpus

138 views
Skip to first unread message

Anthony Palomba

unread,
Mar 13, 2023, 12:51:24 PM3/13/23
to music21
Hey folks,

I am sure this question may have come up already so forgive me for repeating it. But does anyone know if there is a solution out there where I can train an AI model on a MIDI corpus? Does music21 have something built in to do this? I know tensorflow has a lot of support for this, has anyone tried this? It seems like the AI world is changing so fast that it is hard to know what model to create (RNN, GAN, Xformer).

Any feedback would be appreciated.


Best,
Anthony

Joaquín Alberto Padilla Tapia

unread,
Mar 13, 2023, 12:58:46 PM3/13/23
to music...@googlegroups.com
Hi Anthony, yes there are some solutions for this. The best one in my opinion is using an LSTM model and in this particular case there is a really good example in kaggle, search for music data sets and you will find it

--
--
To Post: email music...@googlegroups.com
To Unsubscribe: email music21list...@googlegroups.com
Archives, Options, etc: http://groups.google.com/group/music21list

---
You received this message because you are subscribed to the Google Groups "music21" group.
To unsubscribe from this group and stop receiving emails from it, send an email to music21list...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/music21list/CAFZXy%3DdWu%3DcOh4qVF6tWh%3DkvHwV22_xOcP4sugdBc%3DP_fiH7FA%40mail.gmail.com.

Robby Nevels

unread,
Mar 29, 2023, 7:06:47 PM3/29/23
to music21
Here was my attempt using PerformanceRNN: https://www.kaggle.com/code/robbynevels/performancernn

Robinson McClellan

unread,
May 12, 2023, 11:31:23 AM5/12/23
to music21
I am interested in this as well. Anthony, I would be curious to hear what you've found so far. Likewise, rjne... I would be interested to learn more about your work on this using PerformanceRNN.

My goal is to train a model on a small set of MIDI or MusicXML files, to generate new music in the style of the samples. At this stage I would be most interested in finding someone who could do most of the process for me, in conversation with me. I also hope to develop the skills to build a model myself.

I would love to connect with anyone interested in this type of project.

Thank you!
Robin

Muse Score

unread,
May 12, 2023, 1:05:26 PM5/12/23
to music...@googlegroups.com
Hi Robinson,

You might be interested in this try of mine:
The music is trained with LSTM on two piano pieces of Beethoven and here is some result:
It has been a while though since I looked into the code, and I am not sure if it works or what to do with it if not. :(
In case you are interested in the more theoretical part of it:
Just my two cents.


Robinson McClellan

unread,
May 12, 2023, 1:23:15 PM5/12/23
to music21
Hello, thank you for sharing this. It's definitely in the area I'm interested and the results are nice. I would be interested in discussing more with you, if you have time. 

Anthony Palomba

unread,
May 13, 2023, 11:54:33 AM5/13/23
to music...@googlegroups.com
Hey Robinson,

Glad to hear you are interested. Unfortunately I have been so busy with other things that I have not
had much time to pursue this much further.

Looks like a good start.

But what I ultimately want is to develop a set of composition tools that allow me to take bass, melody, and chord progression and use Ai to create orchestration. This would speed up my composition process. But learning how these models work would help in this endeavor.

I think taking the above RNN example and converting it to a GAN would give better results.

I would love to keep and touch and share our findings.


Best,
Anthony

 

Robinson McClellan

unread,
May 15, 2023, 10:22:33 AM5/15/23
to music21
Hi Anthony,

Your project sounds great. It reminds me of apps like Waterlogue that take a photo and turn it into a watercolor (correct me if this is not how you are thinking about it). In other words the human creates the musical content - the bass, melody, etc - and the model handles the "details" of orchestrating it out (I do not mean to dismiss the beautiful and refined art of orchestration!).

In a way my interest is the inverse, but related. I want the model to compose new/original melodies, harmonies, counterpoint based on custom training data. At least at first, the orchestration aspect could remain fairly basic, for example it could be limited to producing keyboard music. Ultimately my hope would be that it could do this on a level similar to GPT-4's current ability to write original poems, stories, etc. But from what I understand so far, music generation seems to be quite far behind text/image generation in this regard - especially in formats like MIDI and XML (audio is further along). I don't know whether that's because there is less interest in it, or because it's technically more challenging. 

I appreciate your suggestion to try Robby's PerformanceRNN. I don't have the skills to tackle it on my own, though I've found GPT-4 to be a very helpful tutor on some other projects I've tried, so I'll give it a shot. I would want to use my own dataset instead of the one it uses, which (as I understand it) was encoded in Magenta's NoteSequence. So my next step is to try to convert my MIDI files using NoteSequence.

I would be interested to hear your thoughts on GAN vs RNN in this case.

Yes, let's definitely keep in touch and share findings as we go along.

Best,
Robin
Reply all
Reply to author
Forward
0 new messages